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:
            main:
                type: stream
                path: "%kernel.logs_dir%/%kernel.environment%.log"
                level: error
                channels: ["!event"]
            console:
                type: console
                process_psr_3_messages: false
                channels: ["!event", "!doctrine", "!console"]
            mattermost_filter:
                type: fingers_crossed
                action_level: error # Déclenche l'envoi uniquement à partir du niveau ERROR
                handler: mattermost
                excluded_http_codes: [404, 403]
            mattermost:
                type: slackwebhook
                webhook_url: '%env(MATTERMOST_WEBHOOK_URL)%'
                bot_name: 'Symfony Bot' # Nom de l'auteur du message dans Mattermost
                icon_emoji: ':boom:'   # Emoji pour illustrer le message
                level: error
