Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.x] Allow configurable emergency logger #30873

Merged
merged 4 commits into from
Dec 18, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/Illuminate/Log/LogManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,17 @@ protected function parseTap($tap)
/**
* Create an emergency log handler to avoid white screens of death.
*
* @return \Psr\Log\LoggerInterface
* @return \Illuminate\Log\Logger|\Psr\Log\LoggerInterface
*/
protected function createEmergencyLogger()
{
return new Logger(new Monolog('laravel', $this->prepareHandlers([new StreamHandler(
$this->app->storagePath().'/logs/laravel.log', $this->level(['level' => 'debug'])
)])), $this->app['events']);
$config = $this->configurationFor('emergency');

return new Logger(
new Monolog('laravel', $this->prepareHandlers([
new StreamHandler($config['path'], $this->level(['level' => 'debug'])),
GrahamCampbell marked this conversation as resolved.
Show resolved Hide resolved
])), $this->app['events']
);
}

/**
Expand Down