Skip to content

Commit 83abea5

Browse files
tempStephan Wentz
andauthored
Log 404 errors with log level info, to prevent log-spamming. (#711)
Co-authored-by: Stephan Wentz <[email protected]>
1 parent 1b3adcc commit 83abea5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Response.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ private function getResolveStatus(): bool
357357
$this->resolveResult = new $class(...$args);
358358
}
359359

360+
$code = null;
360361
$message = null;
361362
$context = ['exception' => $this->resolveResult];
362363
if ($this->resolveResult instanceof HttpException) {
@@ -372,7 +373,12 @@ private function getResolveStatus(): bool
372373
}
373374

374375
if ($this->resolveResult instanceof Exception) {
375-
$this->logger->error($message ?? $this->resolveResult->getMessage(), $context);
376+
if (404 === $code) {
377+
$this->logger->info($message ?? $this->resolveResult->getMessage(), $context);
378+
} else {
379+
$this->logger->error($message ?? $this->resolveResult->getMessage(), $context);
380+
}
381+
376382
$this->didThrow = true;
377383

378384
throw $this->resolveResult;

0 commit comments

Comments
 (0)