Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mrwaim opened this issue May 26, 2015 · 0 comments
Open

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

mrwaim opened this issue May 26, 2015 · 0 comments

Comments

@mrwaim
Copy link

mrwaim commented May 26, 2015

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!

gyurobenjamin pushed a commit to gyurobenjamin/laravel-request-logger that referenced this issue Oct 23, 2017
Update RequestInterpolation.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant