GithubHelp home page GithubHelp logo

andersao / laravel-request-logger Goto Github PK

View Code? Open in Web Editor NEW
241.0 241.0 56.0 69 KB

HTTP request logger middleware for Laravel

Home Page: http://andersao.github.io/laravel-request-logger

PHP 100.00%

laravel-request-logger's People

Contributors

andersao avatar josemf avatar omranic avatar ozanmuyes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-request-logger's Issues

Compatibility with Laravel 5.6

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.

Cannot find the log file.

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.

In Laravel 5.5.25 does not work

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');
});

Bug in ResponseLoggerMiddleware.php

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.

Log file not created.

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?

Method before does not exist.

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>]...

Missing request-logger.exclude

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

Is't working with Lumen ?

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

Error thrown when $exclude == null in ResponseLoggerMiddleware.php

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

LogTask extends App\Jobs\Job, this won't exist in many cases.

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.

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

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.