andersao / andersao/laravel-request-logger

App::abort - response and request does not get logged - Laravel 5

Offen
#1 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
PHP
Sterne
240
Forks
57
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I created a simple route

Route::get('/error', function () {
abort(404, 'My Error Page');
});

When I hit the route, nothing gets logged.

Here is the binding
LoggerServiceProvider.php
app('router')->after('Prettus\RequestLogger\Filters\ResponseLogger');

ResponseLogger.php
public function filter(Request $request, Response $response)

filter function is never called.

I see two ways of catching errors in laravel - http://laravel.com/docs/master/errors#handling-errors as well as http://laravel.com/docs/master/middleware#terminable-middleware

The first one, I dont know, and doubt, that the request/response information will be available.

The second one looks promising, however,
http://laravel.com/api/5.0/Illuminate/Routing/Router.html doesnt expose a "terminate()" method, it only exposes middlewhere.

Its fairly important for me, to have logs that include error results.

Thanks for taking a look!

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.