monolog:
    channels: ['cron', 'cron_mail', 'main', 'console', 'main_critical', 'streamed_critical']
    handlers:
        # Cron logs with rotation
        cron:
            type: rotating_file
            max_files: 10
            path: "%kernel.logs_dir%/cron-%kernel.environment%.log"
            level: debug
            channels: ["cron"]
        cron_mail:
            type: fingers_crossed
            action_level: info
            handler: cron_mail_swift
            channels: ["cron"]
            activation_strategy: App\Monolog\CronLogMailActivationStrategy
        cron_mail_swift:
            type: swift_mailer
            from_email: "%env(EMAIL_ERROR_FROM)%"
            to_email: "%env(EMAIL_ERROR)%"
            subject: '[Kohinos] Journal cron %%datetime%%'
            level: debug
            formatter: monolog.formatter.html
            content_type: text/html
            
        # Main handler for non-critical logs
        main:
            type: fingers_crossed
            action_level: error
            handler: nested
            excluded_404s:
                - ^/
            channels: ["!cron"]
            
        nested:
            type: rotating_file
            max_files: 10
            path: "%kernel.logs_dir%/%kernel.environment%.log"
            level: debug
            
        console:
            type: console
            process_psr_3_messages: false
            channels: ["!event", "!doctrine", "!cron"]
            
        # Critical errors handling (file only, no email)
        main_critical:
            type: fingers_crossed
            action_level: critical
            handler: streamed_critical
            channels: ["!event", "!cron"]
            
        streamed_critical:
            type: rotating_file
            max_files: 10
            path: "%kernel.logs_dir%/%kernel.environment%.critical.log"
            level: critical
            
        # Uncomment to get logging in your browser
        # you may have to allow bigger header sizes in your Web server configuration
        #firephp:
        #    type: firephp
        #    level: info
        #chromephp:
        #    type: chromephp
        #    level: info
