|
...
|
...
|
@@ -18,8 +18,14 @@ class Formatter implements CallbackInterface |
|
|
|
'时间:' . Carbon::now()->toDateTimeString(), '环境:' . config('app.env'), '项目:' . config('app.name'),
|
|
|
|
'参数:' . json_encode($context->getInput()), 'runtime:' . php_sapi_name(), '地址:' . $context->getPath(),
|
|
|
|
'请求方法:' . $context->getMethod(), 'IP:' . $context->getIp(),
|
|
|
|
'异常:' . sprintf('%s(%s)(code:%d):at %s:%d', $context->getException(), $context->getMessage(),
|
|
|
|
$context->getCode(), $context->getFile(), $context->getLine()),
|
|
|
|
'异常:' . sprintf(
|
|
|
|
'%s(%s)(code:%d):at %s:%d',
|
|
|
|
$context->getException(),
|
|
|
|
$context->getMessage(),
|
|
|
|
$context->getCode(),
|
|
|
|
$context->getFile(),
|
|
|
|
$context->getLine()
|
|
|
|
),
|
|
|
|
'trace:' . implode(PHP_EOL, $context->getTrace()),
|
|
|
|
];
|
|
|
|
};
|
|
...
|
...
|
@@ -39,7 +45,7 @@ class Formatter implements CallbackInterface |
|
|
|
*/
|
|
|
|
public static function callback(): \Closure
|
|
|
|
{
|
|
|
|
$that = new static;
|
|
|
|
$that = new static();
|
|
|
|
|
|
|
|
if ($formatter = $that->config()) {
|
|
|
|
return $formatter;
|
...
|
...
|
|