Skip to content

Commit

Permalink
Added some extra request and response information to the logging
Browse files Browse the repository at this point in the history
  • Loading branch information
WyriHaximus committed Jan 11, 2018
1 parent 012dbcc commit cc12dac
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Factory.php
Expand Up @@ -49,11 +49,14 @@ public static function create(LoopInterface $loop, LoggerInterface $logger, arra
ipAttribute('client-ip')->
context(function (ServerRequestInterface $request, ResponseInterface $response) {
return [
'client-ip' => $request->getAttribute('client-ip'),
'request-id' => $request->getHeaderLine('X-Uuid'),
'request-method' => $request->getMethod(),
'request-protocol-version' => $request->getProtocolVersion(),
'response-protocol-version' => $response->getProtocolVersion(),
'response-status-code' => $response->getStatusCode(),
'response-time' => $response->getHeaderLine('X-Response-Time'),
'response-time-float' => substr($response->getHeaderLine('X-Response-Time'), 0, -2),
'client-ip' => $request->getAttribute('client-ip'),
'response-status-code' => $response->getStatusCode(),
];
})
;
Expand Down

0 comments on commit cc12dac

Please sign in to comment.