andersao / laravel-request-logger Goto Github PK
View Code? Open in Web Editor NEWHTTP request logger middleware for Laravel
Home Page: http://andersao.github.io/laravel-request-logger
HTTP request logger middleware for Laravel
Home Page: http://andersao.github.io/laravel-request-logger
Hello is it possible to make a change to add compatibility with Laravel 5.6?
From what I've understood it would be a simple change:
in the file src/Prettus/RequestLogger/Logger.php, line 5
change "use Illuminate\Contracts\Logging\Log;" to "use Psr\Log\LoggerInterface as Log;"
and after add the missing method from the abstract class.
Thank you for your availability.
Cheers.
Hi, make please a new release with last changes, so it could be installed via composer without using git repo settings.
Class Illuminate\Contracts\Http\Kernel does not exist"
I would love this package if it is able to save the data to a database table.
Maybe I missed something during configuration, but I can't find the log file anywhere. Will it create the logfile or should I create it? The only log file I have is the default laravel log.
After command:
php artisan vendor:publish --provider="Prettus\RequestLogger\Providers\LoggerServiceProvider"
write in console:
In RouteRegistrar.php line 76:
Attribute [before] does not exist.
I am understand that error in LoggerServiceProvider.php in method register():
app('router')->before(function(){
Benchmarking::start('application');
});
As per the documentation the config file doesn't hold a config variable 'exclude', so it was throwing error in the foreach statement
$exclude = config('request-logger.exclude');
if($exclude){ //Added an if , if an exclude is coming as null so that error was not thrown
foreach($exclude as $path) {
if($request->is($path)) return true;
}
}
return false;
Please fix it.
Hello & thanks for making this package.
Unfortunately I cannot get it to work. The log file doesn't get created - I checked the permissions. I also tried to create the file manually and make sure it has write permissions (I even chmod'd it 777, but that didn't help).
I also tried to create a clean Laravel installation, but that didn't help either.
Laravel Version 5.5.34
OS GNU/Linux 4.4.0-21-generic
Do I need to configure a queue for this package to work? If yes, could you please add the instructions to README.md?
I've tried installing this both ways suggested in the readme.
Here's the output from adding it to the composer.json
file:
$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing paragonie/random_compat (v1.3.0)
- Installing paragonie/random_compat (v1.4.1)
Downloading: 100%
- Removing laravel/framework (v5.2.23)
- Installing laravel/framework (v5.2.24)
Downloading: 100%
Writing lock file
Generating autoload files
> php artisan clear-compiled
[BadMethodCallException]
Method before does not exist.
Script php artisan clear-compiled handling the post-update-cmd event returned with an error
[RuntimeException]
Error Output:
update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>]...
I'm getting this error message seemingly because config('request-logger.exclude') is returning null.
[2016-02-25 00:26:48] local.ERROR: exception 'ErrorException' with message 'Invalid argument supplied for foreach()' in /var/www/html/vendor/prettus/laravel-request-logger/src/Prettus/RequestLogger/Middlewares/ResponseLoggerMiddleware.php:44
Hello
Thank you for this good work , and I'm looking to use it with lumen .
Do your script working well with lumen ?
thank you in advance
The following error get generated:
ErrorException in ResponseLoggerMiddleware.php line 44:
Invalid argument supplied for foreach()
in ResponseLoggerMiddleware.php line 44
at HandleExceptions->handleError('2', 'Invalid argument supplied for foreach()', '/var/www/cyadev/vendor/prettus/laravel-request-logger/src/Prettus/RequestLogger/Middlewares/ResponseLoggerMiddleware.php', '44', array('request' => object(Request), 'exclude' => null)) in ResponseLoggerMiddleware.php line 44
at ResponseLoggerMiddleware->excluded(object(Request)) in ResponseLoggerMiddleware.php line 30
at ResponseLoggerMiddleware->terminate(object(Request), object(Response)) in Kernel.php line 145
at Kernel->terminate(object(Request), object(Response)) in index.php line 58
Is there anyway I can log requests as well?
Not seems to be compatible with Laravel 5.3?
The LogTask extends App\Jobs\Job and therefore assumes the laravel application it is in use with has the namespace App and still contains the default job class. This won't always be the case as the namespace is editable and the job class deletable.
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!
The before and after methods used on the Laravel Router in LoggerServiceProvider on lines 38 and 42 have been deprecated since 5.0 and have been completely removed from Laravel 5.2 which prevents this package from being used.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.