laravel 日志存储任意文件

臭大佬 2021-12-15 21:13:13 537
php  laravel 
简介 laravel 日志存储任意文件

代码

use Monolog\Logger;

(new Logger('任意日志'))->pushHandler(new RotatingFileHandler(storage_path('logs/other.log')))->info('失败了');