问题
I'm having yet another weird case where Symfony 3.3 doesn't produce logs in production environment. My main config has following monolog section:
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
This config is not redefined in any environment-specific config, including config_prod.yml. However, my application doesn't log anything to files in prod
environment (console emits what i've expected), while it does so in dev and test environments. The most common reason would be fingers crossed handler and/or level filter set too high, but this is not the case. What am i missing?
来源:https://stackoverflow.com/questions/46958482/symfony-doesnt-create-logs-in-production-environment