From 0861001396403c2512aeaf5ab02922c3c08d05da Mon Sep 17 00:00:00 2001 From: Anis Ahmad Date: Tue, 13 Aug 2024 20:18:42 +0600 Subject: [PATCH] Checking availability before calling Log::flushSharedContext() method --- src/Illuminate/Queue/QueueServiceProvider.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Queue/QueueServiceProvider.php b/src/Illuminate/Queue/QueueServiceProvider.php index 478352ae7e76..95154bf980c7 100755 --- a/src/Illuminate/Queue/QueueServiceProvider.php +++ b/src/Illuminate/Queue/QueueServiceProvider.php @@ -198,7 +198,9 @@ protected function registerWorker() }; $resetScope = function () use ($app) { - $app['log']->flushSharedContext(); + if (method_exists($app['log'], 'flushSharedContext')) { + $app['log']->flushSharedContext(); + } if (method_exists($app['log'], 'withoutContext')) { $app['log']->withoutContext();