【问题标题】:Symfony3.4 monolog bundle not writing to custom channel fileSymfony3.4 独白包未写入自定义频道文件
【发布时间】:2019-02-23 06:58:26
【问题描述】:

当我在独白中添加自定义频道时,文件未创建且未登录到文件。

我的 config_dev.yml

debugchannel:
            level: debug
            type: stream
            path: "%kernel.logs_dir%/debug_%kernel.environment%.log"  
            channels: ['debugchannel']
            formatter: application_debug.formatter.debug  

文件未创建。

【问题讨论】:

  • 您是否使用[..., '!debugchannel']从主调试器中排除了通道?
  • debugchannel 是顶级处理程序吗?您如何使用记录器服务?

标签: symfony monolog


【解决方案1】:

当我按照他们在文档中所说的那样给出这种方式时。它没有向 redis 写入任何数据,也没有发现任何错误。

monolog:
    channels: ["debugchannel"]
    handlers:
        debugchannel:
            level: debug
            type: stream
            path: "%kernel.logs_dir%/debug_%kernel.environment%.log"
        main:
            type: stream
            path: '%kernel.logs_dir%/%kernel.environment%.log'
            level: debug
            channels: ['!event','!debuggchannel']

【讨论】:

  • 尝试在调试通道处理程序中添加channels: ['debugchannel']
猜你喜欢
  • 2018-09-16
  • 1970-01-01
  • 1970-01-01
  • 2022-07-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-06-16
相关资源
最近更新 更多