mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-09 08:02:48 +08:00
增加record_trace配置参数用于日志记录trace信息
This commit is contained in:
@@ -155,6 +155,8 @@ return [
|
|||||||
'show_error_msg' => false,
|
'show_error_msg' => false,
|
||||||
// 异常处理handle类 留空使用 \think\exception\Handle
|
// 异常处理handle类 留空使用 \think\exception\Handle
|
||||||
'exception_handle' => '',
|
'exception_handle' => '',
|
||||||
|
// 是否记录trace信息到日志
|
||||||
|
'record_trace' => false,
|
||||||
|
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 日志设置
|
// | 日志设置
|
||||||
|
|||||||
@@ -52,6 +52,10 @@ class Handle
|
|||||||
$log = "[{$data['code']}]{$data['message']}";
|
$log = "[{$data['code']}]{$data['message']}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Config::get('record_trace')) {
|
||||||
|
$log .= "\r\n" . $exception->getTraceAsString();
|
||||||
|
}
|
||||||
|
|
||||||
Log::record($log, 'error');
|
Log::record($log, 'error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user