Log the error output for API

This commit is contained in:
Dane Everitt 2016-10-07 16:10:54 -04:00
parent af68dbed8f
commit c8a73fa608
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
3 changed files with 11 additions and 9 deletions

View file

@ -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(),