From a9fa1bf91aa59da0ffb87cf112869a40803edc5b Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 4 Jan 2018 14:26:12 -0600 Subject: [PATCH] tweaks from feedback --- src/Illuminate/Log/LogManager.php | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/src/Illuminate/Log/LogManager.php b/src/Illuminate/Log/LogManager.php index 74989560cd1c..cb5df81abe9f 100644 --- a/src/Illuminate/Log/LogManager.php +++ b/src/Illuminate/Log/LogManager.php @@ -102,9 +102,9 @@ protected function get($name) }); } catch (Throwable $e) { return tap($this->createEmergencyLogger(), function ($logger) use ($e) { - $logger->emergency('Unable to create configured logger. Using emergency logger.'); - - $logger->emergency($e); + $logger->emergency('Unable to create configured logger. Using emergency logger.', [ + 'exception' => $e, + ]); }); } } @@ -299,26 +299,6 @@ protected function formatter() }); } - /** - * Monitor log messages and execute a callback if a message matches a given truth test. - * - * @param callable|string $watcher - * @param callable $callback - * @return void - */ - public function watch($watcher, $callback) - { - $watcher = is_callable($watcher) ? $watcher : function ($level, $message) use ($watcher) { - return Str::is($watcher, $message); - }; - - $this->app['events']->listen(MessageLogged::class, function ($event) use ($watcher, $callback) { - if ($watcher($event->level, $event->message, $event->context)) { - $callback($event->level, $event->message, $event->context); - } - }); - } - /** * Extract the log channel from the given configuration. *