Skip to content

Commit bc1b36b

Browse files
committed
[HttpKernel] Add request uri to Logger context
... so host info does not get lost in the logging. The current situation does not allow the user to determine at which host an error occured. | Q | A | ------------- | --- | Bug fix? | [no] | New feature? | [yes] | BC breaks? | [no] | Deprecations? | [no] | Tests pass? | [yes] | Fixed tickets | | License | MIT | Doc PR | Fixed typo Distinguish route-params from request-uri Update context consistency ... and inline the context variable. Rename `route_params` to `route_parameters`
1 parent 0660226 commit bc1b36b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

EventListener/RouterListener.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,10 @@ public function onKernelRequest(GetResponseEvent $event)
140140
}
141141

142142
if (null !== $this->logger) {
143-
$this->logger->info(sprintf('Matched route "%s"', $parameters['_route']), $parameters);
143+
$this->logger->info(sprintf('Matched route "%s"', $parameters['_route']), array(
144+
'route_parameters' => $parameters,
145+
'request_uri' => $request->getUri(),
146+
));
144147
}
145148

146149
$request->attributes->add($parameters);

0 commit comments

Comments
 (0)