<?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', 10))
                    ->setFormatter(new Monolog\Formatter\LineFormatter(null, null, false, false, true)),
                Monolog\Level::Debug,
                Monolog\Level::Debug
            ),
            new Monolog\Handler\FilterHandler(
                (new Monolog\Handler\RotatingFileHandler('/logs/info.log', 10))
                    ->setFormatter(new Monolog\Formatter\LineFormatter(null, null, false, false, true)),
                Monolog\Level::Info,
                Monolog\Level::Warning,
            ),
            new Monolog\Handler\FilterHandler(
                (new Monolog\Handler\RotatingFileHandler('/logs/error.log', 10))
                    ->setFormatter(new Monolog\Formatter\LineFormatter(null, null, false, false, true)),
                Monolog\Level::Error,
                Monolog\Level::Error
            ),
            new Monolog\Handler\FilterHandler(
                (new Monolog\Handler\RotatingFileHandler('/logs/critical.log', 10))
                    ->setFormatter(new Monolog\Formatter\LineFormatter(null, null, false, false, true)),
                Monolog\Level::Critical
            )
        ], [
            $container->get(Monolog\Processor\PsrLogMessageProcessor::class),
            $container->get(Monolog\Processor\IntrospectionProcessor::class),
            $container->get(Monolog\Processor\MemoryUsageProcessor::class),
            $container->get(Monolog\Processor\MemoryPeakUsageProcessor::class)
        ]);
    }
];
