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

when@dev:
    monolog:
        handlers:
            main:
                type: stream
                path: "%kernel.logs_dir%/%kernel.environment%.log"
                level: debug
                channels: ["!event"]
            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:
            # warning+ uniquement : réduit l'I/O disque sur OVH mutualisé.
            # Les exceptions Symfony (error/critical) et les logs applicatifs warning+ restent visibles.
            # runtime.log (RequestProfiler) est indépendant de Monolog.
            main:
                type: rotating_file
                path: "%kernel.logs_dir%/%kernel.environment%.log"
                level: warning
                max_files: 14
                channels: ["!event", "!doctrine", "!deprecation"]
            console:
                type: console
                level: error
                process_psr_3_messages: false
                channels: ["!event", "!doctrine", "!deprecation"]
            deprecation:
                type: null
                channels: [deprecation]
