增加record_trace配置参数用于日志记录trace信息

This commit is contained in:
thinkphp
2017-07-04 19:02:33 +08:00
parent 90d71bbc76
commit 0cfb72c6b5
2 changed files with 6 additions and 0 deletions

View File

@@ -155,6 +155,8 @@ return [
'show_error_msg' => false,
// 异常处理handle类 留空使用 \think\exception\Handle
'exception_handle' => '',
// 是否记录trace信息到日志
'record_trace' => false,
// +----------------------------------------------------------------------
// | 日志设置

View File

@@ -52,6 +52,10 @@ class Handle
$log = "[{$data['code']}]{$data['message']}";
}
if (Config::get('record_trace')) {
$log .= "\r\n" . $exception->getTraceAsString();
}
Log::record($log, 'error');
}
}