【发布时间】:2019-01-14 08:08:41
【问题描述】:
我正在尝试将 webhook 响应记录到保存在 config/logs/custom.log 路径上的自定义日志文件 custom.log 中。我可以通过
轻松地将 webhook 记录到同一目录中的 debug.log 文件中Log::debug('my desired logs)
如何在 custom.log 文件中记录相同的日志。谢谢
【问题讨论】:
标签: php logging cakephp-3.0
我正在尝试将 webhook 响应记录到保存在 config/logs/custom.log 路径上的自定义日志文件 custom.log 中。我可以通过
轻松地将 webhook 记录到同一目录中的 debug.log 文件中Log::debug('my desired logs)
如何在 custom.log 文件中记录相同的日志。谢谢
【问题讨论】:
标签: php logging cakephp-3.0
// Configure logs/custom.log to receive all levels, but only
// those with `custom` scope.
Log::config('custom', [
'className' => 'File',
'path' => LOGS,
'levels' => [],
'scopes' => ['custom'],
'file' => 'custom.log',
]);
Log::debug('this gets written only to custom.log', ['scope' => ['custom']]);
【讨论】: