105 lines
3.9 KiB
YAML
105 lines
3.9 KiB
YAML
monolog:
|
|
channels:
|
|
- deprecation # Deprecations are logged in the dedicated "deprecation" channel when it exists
|
|
# Audit channels, each with its own file in every env (see below).
|
|
# "auth" is the login/logout/authorization trail, "api" one record per
|
|
# proxied backend call. Both are excluded from "main" everywhere, so
|
|
# they never get duplicated — and, in prod, never get swallowed by the
|
|
# fingers_crossed buffer that only flushes on an error.
|
|
- auth
|
|
- api
|
|
|
|
when@dev:
|
|
monolog:
|
|
handlers:
|
|
main:
|
|
type: stream
|
|
path: "%kernel.logs_dir%/%kernel.environment%.log"
|
|
level: debug
|
|
channels: ["!event", "!auth", "!api"]
|
|
console:
|
|
type: console
|
|
process_psr_3_messages: false
|
|
channels: ["!event", "!doctrine", "!console"]
|
|
auth:
|
|
type: rotating_file
|
|
channels: [auth]
|
|
path: "%kernel.logs_dir%/auth.%kernel.environment%.log"
|
|
max_files: 30
|
|
level: info
|
|
api:
|
|
type: rotating_file
|
|
channels: [api]
|
|
path: "%kernel.logs_dir%/api.%kernel.environment%.log"
|
|
max_files: 14
|
|
level: info
|
|
|
|
when@test:
|
|
monolog:
|
|
handlers:
|
|
main:
|
|
type: fingers_crossed
|
|
action_level: error
|
|
handler: nested
|
|
excluded_http_codes: [404, 405]
|
|
channels: ["!event", "!auth", "!api"]
|
|
nested:
|
|
type: stream
|
|
path: "%kernel.logs_dir%/%kernel.environment%.log"
|
|
level: debug
|
|
auth:
|
|
type: rotating_file
|
|
channels: [auth]
|
|
path: "%kernel.logs_dir%/auth.%kernel.environment%.log"
|
|
max_files: 30
|
|
level: info
|
|
api:
|
|
type: rotating_file
|
|
channels: [api]
|
|
path: "%kernel.logs_dir%/api.%kernel.environment%.log"
|
|
max_files: 14
|
|
level: info
|
|
|
|
when@prod:
|
|
monolog:
|
|
handlers:
|
|
main:
|
|
type: fingers_crossed
|
|
action_level: error
|
|
handler: nested
|
|
excluded_http_codes: [404, 405]
|
|
channels: ["!deprecation", "!auth", "!api"]
|
|
buffer_size: 50 # How many messages should be saved? Prevent memory leaks
|
|
nested:
|
|
# Plain rsync/Deployer shared hosting (see deploy.php), not a
|
|
# container — nothing collects stderr here, so log to the
|
|
# shared var/log dir that already survives releases.
|
|
type: rotating_file
|
|
path: "%kernel.logs_dir%/%kernel.environment%.log"
|
|
max_files: 14
|
|
level: debug
|
|
console:
|
|
type: console
|
|
process_psr_3_messages: false
|
|
channels: ["!event", "!doctrine"]
|
|
deprecation:
|
|
type: rotating_file
|
|
channels: [deprecation]
|
|
path: "%kernel.logs_dir%/%kernel.environment%.deprecation.log"
|
|
max_files: 14
|
|
auth:
|
|
# The audit trail: kept longer than everything else, and never
|
|
# routed through fingers_crossed — these info records must land
|
|
# even on a request where nothing went wrong.
|
|
type: rotating_file
|
|
channels: [auth]
|
|
path: "%kernel.logs_dir%/auth.%kernel.environment%.log"
|
|
max_files: 30
|
|
level: info
|
|
api:
|
|
type: rotating_file
|
|
channels: [api]
|
|
path: "%kernel.logs_dir%/api.%kernel.environment%.log"
|
|
max_files: 14
|
|
level: info
|