mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-01-17 21:49:01 +01:00
Smarter monolog integration. Fixes #2823
This commit is contained in:
parent
e95fc790fe
commit
2b2968bca5
@ -27,6 +27,7 @@ use Illuminate\Support\Facades\Redirect;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use Illuminate\Support\Str;
|
||||
use Monolog\Handler\SyslogHandler;
|
||||
|
||||
class SettingsController extends Controller
|
||||
{
|
||||
@ -270,11 +271,15 @@ class SettingsController extends Controller
|
||||
|
||||
$log = app(Writer::class)->getMonolog();
|
||||
|
||||
if (file_exists($path = $log->getHandlers()[0]->getUrl())) {
|
||||
$logContents = file_get_contents($path);
|
||||
} else {
|
||||
$logContents = '';
|
||||
}
|
||||
$logContents = '';
|
||||
|
||||
collect($log->getHandlers())->reject(function ($handler) {
|
||||
return $handler instanceof SyslogHandler;
|
||||
})->each(function ($handler) use ($logContents) {
|
||||
if (file_exists($path = $log->getHandlers()[0]->getUrl())) {
|
||||
$logContents = file_get_contents($path);
|
||||
}
|
||||
});
|
||||
|
||||
return View::make('dashboard.settings.log')->withLog($logContents)->withSubMenu($this->subMenu);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user