Show the latest log output. Closes #2045
This commit is contained in:
@@ -19,6 +19,7 @@ use GrahamCampbell\Binput\Facades\Binput;
|
|||||||
use Illuminate\Routing\Controller;
|
use Illuminate\Routing\Controller;
|
||||||
use Illuminate\Support\Facades\Config;
|
use Illuminate\Support\Facades\Config;
|
||||||
use Illuminate\Support\Facades\Lang;
|
use Illuminate\Support\Facades\Lang;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Support\Facades\Redirect;
|
use Illuminate\Support\Facades\Redirect;
|
||||||
use Illuminate\Support\Facades\Session;
|
use Illuminate\Support\Facades\Session;
|
||||||
use Illuminate\Support\Facades\View;
|
use Illuminate\Support\Facades\View;
|
||||||
@@ -83,6 +84,12 @@ class SettingsController extends Controller
|
|||||||
'icon' => 'ion-stats-bars',
|
'icon' => 'ion-stats-bars',
|
||||||
'active' => false,
|
'active' => false,
|
||||||
],
|
],
|
||||||
|
'log' => [
|
||||||
|
'title' => trans('dashboard.settings.log.log'),
|
||||||
|
'url' => route('dashboard.settings.log'),
|
||||||
|
'icon' => 'ion-document-text',
|
||||||
|
'active' => false,
|
||||||
|
],
|
||||||
'credits' => [
|
'credits' => [
|
||||||
'title' => trans('dashboard.settings.credits.credits'),
|
'title' => trans('dashboard.settings.credits.credits'),
|
||||||
'url' => route('dashboard.settings.credits'),
|
'url' => route('dashboard.settings.credits'),
|
||||||
@@ -243,6 +250,22 @@ class SettingsController extends Controller
|
|||||||
->withSubMenu($this->subMenu);
|
->withSubMenu($this->subMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the most recent log.
|
||||||
|
*
|
||||||
|
* @return \Illuminate\View\View
|
||||||
|
*/
|
||||||
|
public function showLogView()
|
||||||
|
{
|
||||||
|
$this->subMenu['log']['active'] = true;
|
||||||
|
|
||||||
|
$log = Log::getMonolog();
|
||||||
|
|
||||||
|
$logContents = file_get_contents($log->getHandlers()[0]->getUrl());
|
||||||
|
|
||||||
|
return View::make('dashboard.settings.log')->withLog($logContents)->withSubMenu($this->subMenu);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the status page settings.
|
* Updates the status page settings.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -68,6 +68,10 @@ class SettingRoutes
|
|||||||
'as' => 'credits',
|
'as' => 'credits',
|
||||||
'uses' => 'SettingsController@showCreditsView',
|
'uses' => 'SettingsController@showCreditsView',
|
||||||
]);
|
]);
|
||||||
|
$router->get('log', [
|
||||||
|
'as' => 'log',
|
||||||
|
'uses' => 'SettingsController@showLogView',
|
||||||
|
]);
|
||||||
$router->post('/', 'SettingsController@postSettings');
|
$router->post('/', 'SettingsController@postSettings');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -197,6 +197,9 @@ return [
|
|||||||
'analytics' => [
|
'analytics' => [
|
||||||
'analytics' => 'Analytics',
|
'analytics' => 'Analytics',
|
||||||
],
|
],
|
||||||
|
'log' => [
|
||||||
|
'log' => 'Log',
|
||||||
|
],
|
||||||
'localization' => [
|
'localization' => [
|
||||||
'localization' => 'Localization',
|
'localization' => 'Localization',
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
@extends('layout.dashboard')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content-panel">
|
||||||
|
@if(isset($sub_menu))
|
||||||
|
@include('dashboard.partials.sub-sidebar')
|
||||||
|
@endif
|
||||||
|
<div class="content-wrapper">
|
||||||
|
<div class="header sub-header" id="application-setup">
|
||||||
|
<span class="uppercase">
|
||||||
|
{{ trans('dashboard.settings.log.log') }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<textarea class="form-control" rows="40">{{ $log }}</textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
Reference in New Issue
Block a user