<?php
use Psr\Container\ContainerInterface;

return [
    Psr\Log\LoggerInterface::class => function(ContainerInterface $container) {
        return new Monolog\Logger('incoviba', [
            new Monolog\Handler\FilterHandler(
                (new Monolog\Handler\RotatingFileHandler('/logs/debug.log'))
                    ->setFormatter(new Monolog\Formatter\LineFormatter(null, null, false, false, true)),
                Monolog\Level::Debug,
                Monolog\Level::Notice
            ),
            new Monolog\Handler\FilterHandler(
                (new Monolog\Handler\RotatingFileHandler('/logs/error.log'))
                    ->setFormatter(new Monolog\Formatter\LineFormatter(null, null, false, false, true)),
                Monolog\Level::Warning,
                Monolog\Level::Error
            ),
            new Monolog\Handler\FilterHandler(
                (new Monolog\Handler\RotatingFileHandler('/logs/critical.log'))
                    ->setFormatter(new Monolog\Formatter\LineFormatter(null, null, false, false, true)),
                Monolog\Level::Critical
            )
        ], [
            $container->get(Monolog\Processor\PsrLogMessageProcessor::class),
            $container->get(Monolog\Processor\WebProcessor::class),
            $container->get(Monolog\Processor\IntrospectionProcessor::class),
            $container->get(Monolog\Processor\MemoryUsageProcessor::class),
            $container->get(Monolog\Processor\MemoryPeakUsageProcessor::class)
        ]);
    }
];
