Download the PHP package vmpublishing/psr15-middleware-request-logger without Composer
On this page you can find all versions of the php package vmpublishing/psr15-middleware-request-logger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vmpublishing/psr15-middleware-request-logger
More information about vmpublishing/psr15-middleware-request-logger
Files in vmpublishing/psr15-middleware-request-logger
Package psr15-middleware-request-logger
Short Description middleware to log every incoming request and response with varying levels of detail. also log all exceptions (and rethrow them)
License MIT
Informations about the package psr15-middleware-request-logger
WHAT
PSR-15 request logging middleware with as low dependencies as possible.
for maintenance reasons we like a slim, configurable logging middleware, that handles all the logging for us.
- every request
- every response
- every error
- every exception
This will rethrow any errors. error handling should be done on layers further out than this middleware.
INSTALL
To install simply use
composer require vmpublishing/psr15-middleware-request-logger:*@stable
USE
This is a fancy wrapper for psr/log. So you will need to setup your own logger in any way you wish. After that, you can just simply create the middleware and use it
The default setting is notice, and it won't log anything below that, whatever you set as log level in your logger. This is for optimization reasons. The formatter won't build any string or do any array magic, before the log level is sufficient.
If you want to log with a different level than the default, just pass that in:
The StandardLogFormatter can be configured as for which log level to send at which message. just pass in an array to override the defaults. ie:
report any issues/feature requests on github. enjoy!