Symfony doesn't create logs in production environment

偶尔善良 提交于 2019-12-08 04:50:55

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!