andersao / laravel-request-logger

HTTP request logger middleware for Laravel
http://andersao.github.io/laravel-request-logger
242 stars 57 forks source link

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

Open orharel opened 8 years ago

orharel commented 8 years ago

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

aliharis commented 8 years ago

Update the config file to include the exclude parameter.

    'logger' => [
        'enabled'   => true,
        'handlers'  => ['Prettus\RequestLogger\Handler\HttpLoggerHandler'],
        'file'      => storage_path("logs/http.log"),
        'level'     => 'info',
        'format'    => 'common'
    ],
    'exclude' => []
];