Skip to content

Commit 2dcc960

Browse files
[10.x] Moves logger instance creation to a protected method (#48759)
* moves logger instance creation to a protected method * formatting --------- Co-authored-by: Taylor Otwell <[email protected]>
1 parent 8d8d5f7 commit 2dcc960

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Illuminate/Foundation/Exceptions/Handler.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ protected function reportThrowable(Throwable $e): void
302302
}
303303

304304
try {
305-
$logger = $this->container->make(LoggerInterface::class);
305+
$logger = $this->newLogger();
306306
} catch (Exception) {
307307
throw $e;
308308
}
@@ -872,4 +872,14 @@ protected function isHttpException(Throwable $e)
872872
{
873873
return $e instanceof HttpExceptionInterface;
874874
}
875+
876+
/**
877+
* Create a new logger instance.
878+
*
879+
* @return \Psr\Log\LoggerInterface
880+
*/
881+
protected function newLogger()
882+
{
883+
return $this->container->make(LoggerInterface::class);
884+
}
875885
}

0 commit comments

Comments
 (0)