Remove URL from self host error logs

This commit is contained in:
Hillel Coren 2018-04-16 23:50:45 +03:00
parent b0cb73757a
commit 7b7ee5084f

View File

@ -431,14 +431,12 @@ class Utils
public static function prepareErrorData($context) public static function prepareErrorData($context)
{ {
return [ $data = [
'context' => $context, 'context' => $context,
'user_id' => Auth::check() ? Auth::user()->id : 0, 'user_id' => Auth::check() ? Auth::user()->id : 0,
'account_id' => Auth::check() ? Auth::user()->account_id : 0, 'account_id' => Auth::check() ? Auth::user()->account_id : 0,
'user_name' => Auth::check() ? Auth::user()->getDisplayName() : '', 'user_name' => Auth::check() ? Auth::user()->getDisplayName() : '',
'method' => Request::method(), 'method' => Request::method(),
'url' => Input::get('url', Request::url()),
'previous' => url()->previous(),
'user_agent' => isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '', 'user_agent' => isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '',
'locale' => App::getLocale(), 'locale' => App::getLocale(),
'ip' => Request::getClientIp(), 'ip' => Request::getClientIp(),
@ -447,6 +445,15 @@ class Utils
'is_api' => session('token_id') ? 'yes' : 'no', 'is_api' => session('token_id') ? 'yes' : 'no',
'db_server' => config('database.default'), 'db_server' => config('database.default'),
]; ];
if (static::isNinja()) {
$data['url'] = Input::get('url', Request::url());
$data['previous'] = url()->previous();
} else {
$data['url'] = request()->path();
}
return $data;
} }
public static function getErrors() public static function getErrors()