Laravel 创建分类日志
$monolog = Log::getMonolog();
$monolog->popHandler();
$logDir = 'logs/pay/'.date('Ymd');
$logPath = 'logs/pay/'.date('Ymd').'/info.log';
$storagePath = storage_path($logPath);
if(!is_dir(storage_path($logDir))){
mkdir(storage_path($logDir));
}
if(!file_exists($storagePath)){
fopen($storagePath,'w');
}
Log::useFiles($storagePath);
laravel 5.6以下版本使用
本作品采用《CC 协议》,转载必须注明作者和本文链接
推荐文章: