Skip to content

Commit

Permalink
Logging full response from middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
orasik authored Mar 16, 2017
1 parent 65d4565 commit 50ba984
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/MonologMiddleware/MonologMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ public function __construct(Logger $logger, loggableProvider $loggableProvider)
*/
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next = null)
{
$nextResponse = $next($request, $response)
$level = $this->getLogLevel($response->getStatusCode());

$this->log($level, $request, $response);
$this->log($level, $request, $nextResponse);

return $next($request, $response);
return $nextResponse;
}

/**
Expand Down

0 comments on commit 50ba984

Please sign in to comment.