You can now add your own custom logic to specify if a request/response should be logged. Comes with 3 new adapters out of the box:
- LogAll - log request & response
- LogClientErrorsOnly - log only responses that have an http status code of 4XX
- LogSuccessOnly - log only responses that have an http status code of 2XX
Upgrade from 1.0.X -> 2.0.X
- Install v2.0.X with composer
- Add the following to the bottom of your
config/log-requests-and-responses.php
:
/**
* The class responsible for determining if a request should be logged.
*
* Out of the box options are:
* Mtownsend\RequestResponseLogger\Support\Logging\LogAll::class,
* Mtownsend\RequestResponseLogger\Support\Logging\LogClientErrorsOnly::class,
* Mtownsend\RequestResponseLogger\Support\Logging\LogSuccessOnly::class,
*/
'should_log_handler' => \Mtownsend\RequestResponseLogger\Support\Logging\LogAll::class,