本篇文章小编给大家分享一下使用laravel指定日志文件记录任意日志实例,小编觉得挺不错的,现在分享给大家供大家参考,有需要的小伙伴们可以来看看。
如下所示:
(new Logger('邮件发送失败'))
->pushHandler(new RotatingFileHandler(storage_path('logs/email_send.log')))
->info(json_encode([
'data' => $notifiable,
'error' => $e->getMessage()
],320));
实际效果如下:
方式二:
use Log;
...
public function testLog()
{
$customer_id = 111;
$code = 333;
Log::getMonolog()->popHandler();
Log::useFiles(storage_path('logs/data_info_market.log'), 'info');
Log::info('==>id=' . $customer_id . ',code=' . $code);
}
比熊漫画最新版本下载免费-比熊漫画最新版本下载安装手机
华为路由ax2pro如何隐藏信号(华为路由ax2pro隐藏信号方法)
华为路由ax2pro和ax3 pro区别(华为路由ax2pro和ax3 pro不同点是什么)
duyin抖音网页版官方平台入口-duyin抖音官网首页网页版地址
华为路由ax2pro安装教程(华为路由ax2pro怎么安装)
系统验收测试从3天缩短到3小时:用 TRAE Work 跑完30+接口并自动生成验收报告