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

when@dev:
    monolog:
        handlers:
          #  handler system_history pour dev
            system_history:
              type: rotating_file
              path: "%kernel.logs_dir%/system_history.log"
              level: info
              max_files: 30
              channels: [ "system_history" ]
              formatter: monolog.formatter.json

            main:
                type: stream
                path: "%kernel.logs_dir%/%kernel.environment%.log"
                level: debug
                channels: ["!event"]
            # uncomment to get logging in your browser
            # you may have to allow bigger header sizes in your Web server configuration
            #firephp:
            #    type: firephp
            #    level: info
            #chromephp:
            #    type: chromephp
            #    level: info
            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
            system_history:
              type: rotating_file
              path: "%kernel.logs_dir%/system_history.log"
              level: info
              max_files: 30
              channels: [ "system_history" ]
              formatter: monolog.formatter.json

when@prod:
    monolog:
        handlers:
          # Handler system_history pour prod
            system_history:
              type: rotating_file
              path: "%kernel.logs_dir%/system_history.log"
              level: info
              max_files: 30
              channels: [ "system_history" ]
              formatter: monolog.formatter.json

            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: "%kernel.logs_dir%/%kernel.environment%.log"
                level: debug
                formatter: monolog.formatter.json
            console:
                type: console
                process_psr_3_messages: false
                channels: ["!event", "!doctrine"]
            deprecation:
                type: stream
                channels: [deprecation]
                path: php://stderr
                formatter: monolog.formatter.json
