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

when@dev:
  monolog:
    handlers:
      recreateCacheCommandLogger:
        level: debug
        type: rotating_file
        path: '%kernel.logs_dir%/%kernel.environment%_recreate-cache-command.log'
        channels: [ "recreateCacheCommandLogger" ]
        max_files: 3
      main:
        type: rotating_file
        path: "%kernel.logs_dir%/%kernel.environment%.log"
        level: debug
        channels: [ "!event", "!deprecation" ]
      console:
        type: console
        process_psr_3_messages: false
        channels: [ "!event", "!doctrine", "!console" ]
      #deprecation:
      #  type: stream
      #  channels: [ deprecation ]
      #  path: "%kernel.logs_dir%/deprecations.log"

when@test:
  monolog:
    handlers:
      recreateCacheCommandLogger:
        level: error
        type: rotating_file
        path: '%kernel.logs_dir%/%kernel.environment%-cache.log'
        channels: [ "recreateCacheCommandLogger" ]
        max_files: 3
      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
        channels: [ "!recreateCacheCommandLogger", "!deprecation" ]
      nested:
        type: rotating_file
        path: "%kernel.logs_dir%/%kernel.environment%.log"
        level: debug
        formatter: monolog.formatter.json
      console:
        type: console
        process_psr_3_messages: false
        channels: [ "!event", "!doctrine", "!recreateCacheCommandLogger" ]

when@prod:
  monolog:
    handlers:
      recreateCacheCommandLogger:
        level: error
        type: rotating_file
        path: '%kernel.logs_dir%/%kernel.environment%-cache.log'
        channels: [ "recreateCacheCommandLogger" ]
        max_files: 3
      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
        channels: [ "!recreateCacheCommandLogger", "!deprecation" ]
      nested:
        type: rotating_file
        path: "%kernel.logs_dir%/%kernel.environment%.log"
        level: debug
        formatter: monolog.formatter.json
      console:
        type: console
        process_psr_3_messages: false
        channels: [ "!event", "!doctrine", "!recreateCacheCommandLogger" ]