我正在尝试将Webhook响应记录到自定义日志文件custom.log中,该文件保存在config / logs / custom.log路径中。我可以通过
轻松将webhook登录到同一目录中的debug.log文件。Log::debug('my desired logs)
如何在custom.log文件中记录相同的日志。谢谢
答案 0 :(得分: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']]);