You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

85 lines
3.2 KiB

# Dev: debug → dev.log only; info and above → dev.log + stderr.
# Prod: debug–notice → prod.log only; warning+ → prod.log + stderr. Deprecations: stderr (JSON) only.
# Log rotation: Monolog’s rotating_file rolls daily and keeps the last N files (caps growth; not a strict MB cap).
#
# Deprecation channel: vendor (e.g. phrity/websocket extending Nyholm @final Request/Response via
# WebSocket\Http\*) is noisy; exclude from console and main dev.log, route to deprecation.log.
monolog:
channels:
- deprecation # Deprecations are logged in the dedicated "deprecation" channel when it exists
when@dev:
monolog:
handlers:
# Each member gets every record; level filters which are actually written.
main:
type: group
members: [file, docker]
channels: ["!event"]
file:
type: rotating_file
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
max_files: 14
channels: [ "!deprecation" ]
deprecation_file:
type: rotating_file
path: "%kernel.logs_dir%/deprecation.log"
level: debug
max_files: 7
channels: [deprecation]
docker:
type: stream
path: "php://stderr"
# Min level info: debug stays out of stderr (file only).
level: info
# User deprecations (vendor) still land in var/log/…; avoid duplicating to Docker stderr.
channels: [ "!event", "!deprecation" ]
console:
type: console
process_psr_3_messages: false
# CLI (articles:get, prewarm): do not print vendor E_USER_DEPRECATED noise to the terminal.
channels: [ "!event", "!doctrine", "!console", "!deprecation" ]
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:
# No fingers_crossed: we split explicitly between file (all) and stderr (warning+ only).
main:
type: group
members: [file, stderr]
channels: ["!deprecation", "!event"]
file:
type: rotating_file
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
max_files: 30
stderr:
type: stream
path: php://stderr
level: warning
formatter: monolog.formatter.json
console:
type: console
process_psr_3_messages: false
channels: [ "!event", "!doctrine", "!deprecation" ]
deprecation:
type: stream
channels: [deprecation]
path: php://stderr
formatter: monolog.formatter.json