From 03f870cb0b0eefde363b8985843aba68446a407c Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 18 Jan 2018 08:24:18 -0600 Subject: [PATCH] add stack method --- src/Illuminate/Log/LogManager.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Illuminate/Log/LogManager.php b/src/Illuminate/Log/LogManager.php index 3629e1c2c629..b9514d2d1106 100644 --- a/src/Illuminate/Log/LogManager.php +++ b/src/Illuminate/Log/LogManager.php @@ -65,6 +65,21 @@ public function __construct($app) $this->app = $app; } + /** + * Create a new, on-demand aggregate logger instance. + * + * @param array $channels + * @param string|null $channel + * @return \Psr\Log\LoggerInterface + */ + public function stack(array $channels, $channel = null) + { + return new Logger( + $this->createAggregateDriver(compact('channels', 'channel')), + $this->app['events'] + ); + } + /** * Get a log channel instance. *