diff --git a/src/Illuminate/Log/LogManager.php b/src/Illuminate/Log/LogManager.php index df506b92a271..b43afbacf435 100644 --- a/src/Illuminate/Log/LogManager.php +++ b/src/Illuminate/Log/LogManager.php @@ -113,7 +113,7 @@ protected function get($name) { try { return $this->channels[$name] ?? with($this->resolve($name), function ($logger) use ($name) { - return $this->tap($name, new Logger($logger, $this->app['events'])); + return $this->channels[$name] = $this->tap($name, new Logger($logger, $this->app['events'])); }); } catch (Throwable $e) { return tap($this->createEmergencyLogger(), function ($logger) use ($e) { diff --git a/tests/Log/LogManagerTest.php b/tests/Log/LogManagerTest.php new file mode 100755 index 000000000000..3c788d92d22b --- /dev/null +++ b/tests/Log/LogManagerTest.php @@ -0,0 +1,19 @@ +app); + + $logger1 = $manager->channel('single')->getLogger(); + $logger2 = $manager->channel('single')->getLogger(); + + $this->assertSame($logger1, $logger2); + } +}