如何在cakephp应用程序中将日志添加到自定义文件?
我试图记录对保存在config/logs/custom.log路径上的自定义日志文件custom.log的webhook响应。我可以通过以下方式轻松地将webhook记录到同一目录中的debug.log文件中:如何在cakephp应用程序中将日志添加到自定义文件?,php,logging,cakephp-3.0,Php,Logging,Cakephp 3.0,我试图记录对保存在config/logs/custom.log路径上的自定义日志文件custom.log的webhook响应。我可以通过以下方式轻松地将webhook记录到同一目录中的debug.log文件中: Log::debug('my desired logs) 如何在custom.log文件中记录相同的日志。谢谢你你查过了吗? // Configure logs/custom.log to receive all levels, but only // those with `cust
Log::debug('my desired logs)
如何在custom.log文件中记录相同的日志。谢谢你你查过了吗?
// 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']]);