我还有另一个奇怪的例子,Symfony 3.3在生产环境中不生成日志。我的主配置有以下monolog部分:
monolog:
channels:
- job.execution
- job.clean-up
- job.notification
handlers:
main:
type: rotating_file
max_files: 10
path: '%kernel.logs_dir%/%kernel.environment%/application.log'
level: debug
formatter: Monolog\Formatter\LineFormatter
channels:
- '!event'
- '!job.execution'
- '!job.clean-up'
- '!job.notification'
console:
type: console
channels: ['!event', '!doctrine']
formatter: Monolog\Formatter\LineFormatter
job.execution:
type: rotating_file
max_files: 10
path: '%kernel.logs_dir%/%kernel.environment%/job.execution.log'
level: debug
formatter: Monolog\Formatter\LineFormatter
channels: job.execution
# same definitions for job.notification and job.clean-up
此配置未在任何特定于环境的配置中重新定义,包括config_prod.yml。但是,我的应用程序不会将任何内容记录到prod
环境中的文件(控制台发出我期望的内容),而它在开发和测试环境中会这样做。最常见的原因是手指交叉处理程序和/或级别过滤器设置得太高,但事实并非如此。我错过了什么?