Log the error output for API
This commit is contained in:
parent
af68dbed8f
commit
c8a73fa608
3 changed files with 11 additions and 9 deletions
|
@ -36,7 +36,7 @@ class APILogService
|
|||
//
|
||||
}
|
||||
|
||||
public static function log(Request $request, $authorized = false)
|
||||
public static function log(Request $request, $error = null, $authorized = false)
|
||||
{
|
||||
if ($request->bearerToken() && !empty($request->bearerToken())) {
|
||||
list($public, $hashed) = explode('.', $request->bearerToken());
|
||||
|
@ -47,6 +47,7 @@ class APILogService
|
|||
try {
|
||||
$log = APILog::create([
|
||||
'authorized' => $authorized,
|
||||
'error' => $error,
|
||||
'key' => $public,
|
||||
'method' => $request->method(),
|
||||
'route' => $request->fullUrl(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue