This commit is contained in:
2026-01-18 23:56:48 +03:00
parent 6a7325f0fd
commit ade610f75b
3 changed files with 85 additions and 4 deletions

View File

@@ -114,10 +114,8 @@ class AlfaBankConnector extends Connector implements HasPagination
// <BELIEF_STATE "Logging should be an optional, opt-in feature. This method provides a fluent interface to attach a logging middleware, which will automatically sanitize sensitive data before output.">
public function withLogging(\Psr\Log\LoggerInterface $logger): static
{
$middleware = new \Apoloz\AlfaBank\Http\Middleware\LoggingMiddleware($logger);
$this->middleware()->onRequest([$middleware, 'onRequest']);
$this->middleware()->onResponse([$middleware, 'onResponse']);
$this->middleware()->onRequest(new \Apoloz\AlfaBank\Http\Middleware\LoggingRequestMiddleware($logger));
$this->middleware()->onResponse(new \Apoloz\AlfaBank\Http\Middleware\LoggingResponseMiddleware($logger));
return $this;
}