【发布时间】:2021-08-21 00:44:34
【问题描述】:
我将 Drupal 8 与 Monolog 模块 (1.3) 一起用于外部日志支持和 Sentry 日志记录,同时保留核心数据库日志记录 (dblog/watchdog)。这一切都有效,除了我找不到控制看门狗日志记录级别的方法(所以我在生产环境中获得了很多调试日志记录)。
这是我的独白配置(monolog.services.yml):
parameters:
monolog.channel_handlers:
default: ['drupal.dblog', 'drupal.raven']
custom1: ['rotating_file_custom1']
custom2: ['rotating_file_custom2']
custom3: ['rotating_file_custom3']
services:
monolog.handler.rotating_file_custom1:
class: Monolog\Handler\RotatingFileHandler
arguments: ['file://../logs/custom1.log', 25, 'monolog.level.debug']
monolog.handler.rotating_file_custom2:
class: Monolog\Handler\RotatingFileHandler
arguments: ['file://../logs/custom2.log', 25, 'monolog.level.debug']
monolog.handler.rotating_file_custom3:
class: Monolog\Handler\RotatingFileHandler
arguments: ['file://../logs/custom3.log', 25, 'monolog.level.debug' ]
我尝试使用 DrupalHandler 为 drupal.dblog 添加一个新的服务处理程序,但我不知道要使用哪些参数(参数是必需的,并且它期望 LoggerInterface 实现作为第一个参数)。
我已经阅读了模块文档,但它几乎只关注文件/外部日志记录。
有什么建议吗?
TIA
【问题讨论】: