Skip to content

Added custom logic to check if a request/response should be logged

Latest
Compare
Choose a tag to compare
@mtownsend5512 mtownsend5512 released this 08 Oct 23:14
· 1 commit to main since this release

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

  1. Install v2.0.X with composer
  2. 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,