TraceLog -> EventLog
Cms\ErrorLog -> System\RequestLog Set up some basic language keys
This commit is contained in:
parent
16468d224b
commit
93590fb272
|
|
@ -0,0 +1,41 @@
|
|||
<?php namespace Backend\Controllers;
|
||||
|
||||
use Str;
|
||||
use Lang;
|
||||
use File;
|
||||
use Flash;
|
||||
use Backend;
|
||||
use Redirect;
|
||||
use BackendMenu;
|
||||
use Backend\Classes\Controller;
|
||||
use System\Classes\ApplicationException;
|
||||
use System\Classes\SettingsManager;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Access Logs controller
|
||||
*
|
||||
* @package october\system
|
||||
* @author Alexey Bobkov, Samuel Georges
|
||||
*
|
||||
*/
|
||||
class AccessLogs extends Controller
|
||||
{
|
||||
|
||||
public $implement = [
|
||||
'Backend.Behaviors.ListController'
|
||||
];
|
||||
|
||||
public $requiredPermissions = ['system.access_access_logs'];
|
||||
|
||||
public $listConfig = 'config_list.yaml';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
BackendMenu::setContext('October.System', 'system', 'settings');
|
||||
SettingsManager::setContext('October.Backend', 'access_logs');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<div data-control="toolbar">
|
||||
|
||||
</div>
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
# ===================================
|
||||
# List Behavior Config
|
||||
# ===================================
|
||||
|
||||
title: Access Log
|
||||
list: @/modules/backend/models/accesslog/columns.yaml
|
||||
modelClass: Backend\Models\AccessLog
|
||||
recordUrl: backend/accesslogs/preview/:id
|
||||
noRecordsMessage: backend::lang.list.no_records
|
||||
showSetup: false
|
||||
|
||||
toolbar:
|
||||
buttons: list_toolbar
|
||||
search:
|
||||
prompt: backend::lang.list.search_prompt
|
||||
|
|
@ -0,0 +1 @@
|
|||
<?= $this->listRender() ?>
|
||||
|
|
@ -187,4 +187,8 @@ return [
|
|||
'locale' => 'Language',
|
||||
'locale_comment' => 'Select your desired locale for language use.',
|
||||
],
|
||||
'access_log' => [
|
||||
'menu_label' => 'Access Log',
|
||||
'menu_description' => 'View a list of successful back-end user sign ins.',
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
<?php namespace System\Controllers;
|
||||
|
||||
use Str;
|
||||
use Lang;
|
||||
use File;
|
||||
use Flash;
|
||||
use Backend;
|
||||
use Redirect;
|
||||
use BackendMenu;
|
||||
use Backend\Classes\Controller;
|
||||
use System\Classes\ApplicationException;
|
||||
use System\Classes\SettingsManager;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Event Logs controller
|
||||
*
|
||||
* @package october\system
|
||||
* @author Alexey Bobkov, Samuel Georges
|
||||
*
|
||||
*/
|
||||
class EventLogs extends Controller
|
||||
{
|
||||
|
||||
public $implement = [
|
||||
'Backend.Behaviors.FormController',
|
||||
'Backend.Behaviors.ListController'
|
||||
];
|
||||
|
||||
public $requiredPermissions = ['system.access_event_logs'];
|
||||
|
||||
public $formConfig = 'config_form.yaml';
|
||||
|
||||
public $listConfig = 'config_list.yaml';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
BackendMenu::setContext('October.System', 'system', 'settings');
|
||||
SettingsManager::setContext('October.System', 'event_logs');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
<?php namespace System\Controllers;
|
||||
|
||||
use Str;
|
||||
use Lang;
|
||||
use File;
|
||||
use Flash;
|
||||
use Backend;
|
||||
use Redirect;
|
||||
use BackendMenu;
|
||||
use Backend\Classes\Controller;
|
||||
use System\Classes\ApplicationException;
|
||||
use System\Classes\SettingsManager;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Request Logs controller
|
||||
*
|
||||
* @package october\system
|
||||
* @author Alexey Bobkov, Samuel Georges
|
||||
*
|
||||
*/
|
||||
class RequestLogs extends Controller
|
||||
{
|
||||
|
||||
public $implement = [
|
||||
'Backend.Behaviors.FormController',
|
||||
'Backend.Behaviors.ListController'
|
||||
];
|
||||
|
||||
public $requiredPermissions = ['system.access_request_logs'];
|
||||
|
||||
public $formConfig = 'config_form.yaml';
|
||||
|
||||
public $listConfig = 'config_list.yaml';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
BackendMenu::setContext('October.System', 'system', 'settings');
|
||||
SettingsManager::setContext('October.System', 'request_logs');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<div data-control="toolbar">
|
||||
<a
|
||||
href="<?= Backend::url('system/eventlogs/clear') ?>"
|
||||
class="btn btn-default oc-icon-trash-o">
|
||||
<?= e(trans('system::lang.event_log.empty')) ?>
|
||||
</a>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
# ===================================
|
||||
# Form Behavior Config
|
||||
# ===================================
|
||||
|
||||
# Record name
|
||||
name: Log
|
||||
|
||||
# Model Form Field configuration
|
||||
form: @/modules/system/models/eventlog/fields.yaml
|
||||
|
||||
# Model Class name
|
||||
modelClass: System\Models\EventLog
|
||||
|
||||
# Default redirect location
|
||||
defaultRedirect: system/eventlogs
|
||||
|
||||
# Preview page
|
||||
preview:
|
||||
title: Event
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
# ===================================
|
||||
# List Behavior Config
|
||||
# ===================================
|
||||
|
||||
title: Event Log
|
||||
list: @/modules/system/models/eventlog/columns.yaml
|
||||
modelClass: System\Models\EventLog
|
||||
recordUrl: system/eventlogs/preview/:id
|
||||
noRecordsMessage: backend::lang.list.no_records
|
||||
showSetup: false
|
||||
|
||||
toolbar:
|
||||
buttons: list_toolbar
|
||||
search:
|
||||
prompt: backend::lang.list.search_prompt
|
||||
|
|
@ -0,0 +1 @@
|
|||
<?= $this->listRender() ?>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<?php Block::put('breadcrumb') ?>
|
||||
<ul>
|
||||
<li><a href="<?= Backend::url('system/eventlogs') ?>">System</a></li>
|
||||
<li><?= e($this->pageTitle) ?></li>
|
||||
</ul>
|
||||
<?php Block::endPut() ?>
|
||||
|
||||
<?php if (!$this->fatalError): ?>
|
||||
|
||||
<div class="layout-item stretch layout-column form-preview">
|
||||
<?= $this->formRenderPreview() ?>
|
||||
</div>
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<p class="flash-message static error"><?= e($this->fatalError) ?></p>
|
||||
<p><a href="<?= Backend::url('system/eventlogs') ?>" class="btn btn-default">Return to event log list</a></p>
|
||||
|
||||
<?php endif ?>
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<div data-control="toolbar">
|
||||
<a
|
||||
href="<?= Backend::url('system/requestlogs/clear') ?>"
|
||||
class="btn btn-default oc-icon-trash-o">
|
||||
<?= e(trans('system::lang.request_log.empty')) ?>
|
||||
</a>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
# ===================================
|
||||
# Form Behavior Config
|
||||
# ===================================
|
||||
|
||||
# Record name
|
||||
name: Log
|
||||
|
||||
# Model Form Field configuration
|
||||
form: @/modules/system/models/requestlog/fields.yaml
|
||||
|
||||
# Model Class name
|
||||
modelClass: System\Models\RequestLog
|
||||
|
||||
# Default redirect location
|
||||
defaultRedirect: system/requestlogs
|
||||
|
||||
# Preview page
|
||||
preview:
|
||||
title: Request
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
# ===================================
|
||||
# List Behavior Config
|
||||
# ===================================
|
||||
|
||||
title: Request Log
|
||||
list: @/modules/system/models/requestlog/columns.yaml
|
||||
modelClass: System\Models\RequestLog
|
||||
recordUrl: system/requestlogs/preview/:id
|
||||
noRecordsMessage: backend::lang.list.no_records
|
||||
showSetup: false
|
||||
|
||||
toolbar:
|
||||
buttons: list_toolbar
|
||||
search:
|
||||
prompt: backend::lang.list.search_prompt
|
||||
|
|
@ -0,0 +1 @@
|
|||
<?= $this->listRender() ?>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<?php Block::put('breadcrumb') ?>
|
||||
<ul>
|
||||
<li><a href="<?= Backend::url('system/requestlogs') ?>">System</a></li>
|
||||
<li><?= e($this->pageTitle) ?></li>
|
||||
</ul>
|
||||
<?php Block::endPut() ?>
|
||||
|
||||
<?php if (!$this->fatalError): ?>
|
||||
|
||||
<div class="layout-item stretch layout-column form-preview">
|
||||
<?= $this->formRenderPreview() ?>
|
||||
</div>
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<p class="flash-message static error"><?= e($this->fatalError) ?></p>
|
||||
<p><a href="<?= Backend::url('system/requestlogs') ?>" class="btn btn-default">Return to request log list</a></p>
|
||||
|
||||
<?php endif ?>
|
||||
|
|
@ -3,12 +3,12 @@
|
|||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class DbSystemTraceLog extends Migration
|
||||
class DbSystemEventLogs extends Migration
|
||||
{
|
||||
|
||||
public function up()
|
||||
{
|
||||
Schema::create('system_trace_log', function(Blueprint $table)
|
||||
Schema::create('system_event_logs', function(Blueprint $table)
|
||||
{
|
||||
$table->engine = 'InnoDB';
|
||||
$table->increments('id');
|
||||
|
|
@ -21,7 +21,7 @@ class DbSystemTraceLog extends Migration
|
|||
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('system_trace_log');
|
||||
Schema::dropIfExists('system_event_logs');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -3,16 +3,17 @@
|
|||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class DbCmsErrorLog extends Migration
|
||||
class DbSystemRequestLogs extends Migration
|
||||
{
|
||||
|
||||
public function up()
|
||||
{
|
||||
Schema::create('cms_error_log', function(Blueprint $table)
|
||||
Schema::create('system_request_logs', function(Blueprint $table)
|
||||
{
|
||||
$table->engine = 'InnoDB';
|
||||
$table->increments('id');
|
||||
$table->string('url')->nullable();
|
||||
$table->integer('status_code')->nullable();
|
||||
$table->string('referer')->nullable();
|
||||
$table->integer('count')->default(0);
|
||||
$table->timestamps();
|
||||
|
|
@ -21,7 +22,7 @@ class DbCmsErrorLog extends Migration
|
|||
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('cms_error_log');
|
||||
Schema::dropIfExists('system_request_logs');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -176,4 +176,14 @@ return [
|
|||
'zip' => [
|
||||
'extract_failed' => "Unable to extract core file ':file'.",
|
||||
],
|
||||
'event_log' => [
|
||||
'menu_label' => 'Event Log',
|
||||
'menu_description' => 'View system log messages with their recorded time and details.',
|
||||
'empty' => 'Empty event log',
|
||||
],
|
||||
'request_log' => [
|
||||
'menu_label' => 'Request Log',
|
||||
'menu_description' => 'View bad or redirected requests, such as Page not found (404).',
|
||||
'empty' => 'Empty request log',
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -5,13 +5,13 @@ use Model;
|
|||
/**
|
||||
* Model for logging system errors and debug trace messages
|
||||
*/
|
||||
class TraceLog extends Model
|
||||
class EventLog extends Model
|
||||
{
|
||||
|
||||
/**
|
||||
* @var string The database table used by the model.
|
||||
*/
|
||||
protected $table = 'system_trace_log';
|
||||
protected $table = 'system_event_logs';
|
||||
|
||||
/**
|
||||
* Creates a log record
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
<?php namespace Cms\Models;
|
||||
<?php namespace System\Models;
|
||||
|
||||
use Model;
|
||||
use Request;
|
||||
|
|
@ -6,13 +6,13 @@ use Request;
|
|||
/**
|
||||
* Model for logging 404 errors
|
||||
*/
|
||||
class ErrorLog extends Model
|
||||
class RequestLog extends Model
|
||||
{
|
||||
|
||||
/**
|
||||
* @var string The database table used by the model.
|
||||
*/
|
||||
protected $table = 'cms_error_log';
|
||||
protected $table = 'system_request_logs';
|
||||
|
||||
/**
|
||||
* @var array The attributes that aren't mass assignable.
|
||||
Loading…
Reference in New Issue