Skip to content

Commit

Permalink
refactor: add monolog token from request
Browse files Browse the repository at this point in the history
  • Loading branch information
siganushka committed Oct 29, 2021
1 parent 58d459e commit f576bda
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Monolog/Processor/RequestTokenProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ public function __invoke(array $record): array
{
$request = $this->requestStack->getCurrentRequest();

if (null === $request) {
throw new \LogicException('Request should exist so it can be processed for error.');
}

if ($request->headers->has($this->headerName)) {
if ($request && $request->headers->has($this->headerName)) {
$record['extra'][$this->headerName] = $request->headers->get($this->headerName);
}

Expand Down

0 comments on commit f576bda

Please sign in to comment.