Skip to content

Commit 46dca3d

Browse files
bug symfony#60617 [HttpKernel] pass log level instead of exception to resolve the logger (xabbuh)
This PR was merged into the 7.3 branch. Discussion ---------- [HttpKernel] pass log level instead of exception to resolve the logger | Q | A | ------------- | --- | Branch? | 7.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | | License | MIT Commits ------- 65a8d61 pass log level instead of exception to resolve the logger
2 parents 24b868e + 65a8d61 commit 46dca3d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Symfony/Component/HttpKernel/EventListener/ErrorListener.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,15 +161,15 @@ public static function getSubscribedEvents(): array
161161

162162
/**
163163
* Logs an exception.
164-
*
164+
*
165165
* @param ?string $logChannel
166166
*/
167167
protected function logException(\Throwable $exception, string $message, ?string $logLevel = null, /* ?string $logChannel = null */): void
168168
{
169169
$logChannel = (3 < \func_num_args() ? \func_get_arg(3) : null) ?? $this->resolveLogChannel($exception);
170-
170+
171171
$logLevel ??= $this->resolveLogLevel($exception);
172-
172+
173173
if(!$logger = $this->getLogger($logChannel)) {
174174
return;
175175
}
@@ -218,7 +218,7 @@ protected function duplicateRequest(\Throwable $exception, Request $request): Re
218218
$attributes = [
219219
'_controller' => $this->controller,
220220
'exception' => $exception,
221-
'logger' => DebugLoggerConfigurator::getDebugLogger($this->getLogger($exception)),
221+
'logger' => DebugLoggerConfigurator::getDebugLogger($this->getLogger($this->resolveLogChannel($exception))),
222222
];
223223
$request = $request->duplicate(null, null, $attributes);
224224
$request->setMethod('GET');

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy