monolog:
    channels:
        - honey_pot # Pot de miel pour les formulaires de contact et autres
        - 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: info
                channels: ["!event"]
            doctrine:
                type: stream
                path: "%kernel.logs_dir%/%kernel.environment%.log"
                level: notice
                channels: ["doctrine"]
            honeypot:
                level: info
                type: rotating_file
                max_files: 10
                path: "%kernel.logs_dir%/honeypot/%kernel.environment%.log"
                channels:
                    - honey_pot
            console:
                type: console
                process_psr_3_messages: false
                channels: ["!event", "!doctrine", "!console"]
            deprecation:
                type: stream
                channels: [deprecation]
                path: "%kernel.logs_dir%/deprecations.log"
                formatter: monolog.formatter.json

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:
            main:
                type: fingers_crossed
                action_level: error
                handler: nested
                excluded_http_codes: [404, 405]
                buffer_size: 50 # How many messages should be saved? Prevent memory leaks
            nested:
                type: stream
                path: php://stderr
                level: debug
                formatter: monolog.formatter.json
            honeypot:
                level: info
                type: rotating_file
                max_files: 10
                path: "%kernel.logs_dir%/honeypot/%kernel.environment%.log"
                channels:
                    - honey_pot
