Skip to content

Commit 1402487

Browse files
committed
flush context on all log channels, just not default
1 parent 784bf76 commit 1402487

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/Illuminate/Log/LogManager.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,22 @@ public function sharedContext()
501501
return $this->sharedContext;
502502
}
503503

504+
/**
505+
* Flush the log context on all currently resolved channels.
506+
*
507+
* @return $this
508+
*/
509+
public function withoutContext()
510+
{
511+
foreach ($this->channels as $channel) {
512+
if (method_exists($channel, 'withoutContext')) {
513+
$channel->withoutContext();
514+
}
515+
}
516+
517+
return $this;
518+
}
519+
504520
/**
505521
* Flush the shared context.
506522
*

src/Illuminate/Queue/QueueServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ protected function registerWorker()
198198
};
199199

200200
$resetScope = function () use ($app) {
201-
if (method_exists($app['log']->driver(), 'withoutContext')) {
201+
if (method_exists($app['log'], 'withoutContext')) {
202202
$app['log']->withoutContext();
203203
}
204204

0 commit comments

Comments
 (0)