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: ["!app"]
            app:
                type: stream
                path: "%kernel.logs_dir%/app.%kernel.environment%.log"
                level: debug
                channels: ["app"]
            console:
                type: console
                level: debug
                process_psr_3_messages: false
                channels: ["app"]

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
            telegram:
                type: telegram
                level: critical
                channels: [ "!event" ]
                token: "%env(DEVY_TOKEN)%"
                channel: "%env(DEVY_CHANNEL)%"
                topic: "%env(int:DEVY_TOPIC)%"
                parse_mode: "MarkdownV2"
                disable_webpage_preview: true
                disable_notification: false
                split_long_messages: false
                formatter: Basango\SharedKernel\Infrastructure\Framework\Symfony\Logging\TelegramFormatter
            nested:
                type: rotating_file
                path: "%kernel.logs_dir%/%kernel.environment%.log"
                level: error
                max_files: 10
            console:
                type: console
                level: info
                process_psr_3_messages: false
                channels: ["!event", "!doctrine"]
            deprecation:
                type: stream
                channels: [deprecation]
                path: "%kernel.logs_dir%/deprecation.log"
