Symfony 如何为生产启用某些(不是全部)独白处理程序?
我有一个symfony2应用程序,它有一堆独白处理程序。dev环境的日志记录工作正常,但是我希望一个monog处理程序始终是日志记录,命名为Symfony 如何为生产启用某些(不是全部)独白处理程序?,symfony,production-environment,monolog,Symfony,Production Environment,Monolog,我有一个symfony2应用程序,它有一堆独白处理程序。dev环境的日志记录工作正常,但是我希望一个monog处理程序始终是日志记录,命名为transmission\u recorder,也在prod上。但是对于prod,日志记录是非活动的 我假设手指交叉可能会阻止登录prod,但我不想为所有的monolog处理程序启用所有内容的日志记录,只为一个特定的处理程序启用 我如何做到这一点 以下是我的相关配置: config.yml: monolog: handlers: co
transmission\u recorder
,也在prod上。但是对于prod,日志记录是非活动的
我假设手指交叉
可能会阻止登录prod,但我不想为所有的monolog处理程序启用所有内容的日志记录,只为一个特定的处理程序启用
我如何做到这一点
以下是我的相关配置:
config.yml
:
monolog:
handlers:
console:
type: console
transmission_recorder:
type: service
id: dba.handler.transmission.recorder
imports:
- { resource: config.yml }
monolog:
handlers:
main:
type: rotating_file
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
max_files: 14
channels:
- "!event"
console:
type: console
bubble: false
imports:
- { resource: config.yml }
monolog:
handlers:
main:
type: fingers_crossed
action_level: WARNING
handler: grouped_warning
grouped_warning:
type: group
members:
- file_debug
file_debug:
type: rotating_file
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
max_files: 14
console:
type: console
config_dev.yml
:
monolog:
handlers:
console:
type: console
transmission_recorder:
type: service
id: dba.handler.transmission.recorder
imports:
- { resource: config.yml }
monolog:
handlers:
main:
type: rotating_file
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
max_files: 14
channels:
- "!event"
console:
type: console
bubble: false
imports:
- { resource: config.yml }
monolog:
handlers:
main:
type: fingers_crossed
action_level: WARNING
handler: grouped_warning
grouped_warning:
type: group
members:
- file_debug
file_debug:
type: rotating_file
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
max_files: 14
console:
type: console
config_prod.yml
:
monolog:
handlers:
console:
type: console
transmission_recorder:
type: service
id: dba.handler.transmission.recorder
imports:
- { resource: config.yml }
monolog:
handlers:
main:
type: rotating_file
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
max_files: 14
channels:
- "!event"
console:
type: console
bubble: false
imports:
- { resource: config.yml }
monolog:
handlers:
main:
type: fingers_crossed
action_level: WARNING
handler: grouped_warning
grouped_warning:
type: group
members:
- file_debug
file_debug:
type: rotating_file
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
max_files: 14
console:
type: console
你有没有想过?