monolog:
    channels:
        - deprecation # Deprecations are logged in the dedicated "deprecation" channel when it exists

when@dev:
    monolog:
        handlers:
            error_log:
                type: rotating_file
                path: "%kernel.logs_dir%/error.log"
                level: error
                max_files: 3
                formatter: monolog.formatter.json
            debug_log:
                type: rotating_file
                path: "%kernel.logs_dir%/debug.log"
                level: debug
                max_files: 1
                channels: ["!event", "!doctrine", "!console"]
            console:
                type: console
                process_psr_3_messages: false
                channels: ["!event", "!doctrine", "!console"]

when@test:
    monolog:
        handlers:
            main:
                type: fingers_crossed
                action_level: error
                handler: nested
                excluded_http_codes: [404, 405]
                channels: ["!event"]
            nested:
                type: stream
                path: "%kernel.logs_dir%/%kernel.environment%.log"
                level: debug

when@prod:
    monolog:
        handlers:
            error_log:
                type: rotating_file
                path: "%kernel.logs_dir%/error.log"
                level: error
                max_files: 3
                formatter: monolog.formatter.json
            debug_log:
                type: rotating_file
                path: "%kernel.logs_dir%/debug.log"
                level: debug
                max_files: 1
                channels: ["!event", "!doctrine", "!console"]
            console:
                type: console
                process_psr_3_messages: false
                channels: ["!event", "!doctrine"]
            deprecation:
                type: stream
                channels: [deprecation]
                path: php://stderr
