diff --git a/modules/backend/database/migrations/2014_10_01_000006_Db_Backend_Access_Log.php b/modules/backend/database/migrations/2014_10_01_000006_Db_Backend_Access_Log.php new file mode 100644 index 000000000..84980f211 --- /dev/null +++ b/modules/backend/database/migrations/2014_10_01_000006_Db_Backend_Access_Log.php @@ -0,0 +1,26 @@ +engine = 'InnoDB'; + $table->increments('id'); + $table->integer('user_id')->unsigned(); + $table->string('ip_address')->nullable(); + $table->timestamps(); + }); + } + + public function down() + { + Schema::dropIfExists('backend_access_log'); + } + +} diff --git a/modules/backend/models/AccessLog.php b/modules/backend/models/AccessLog.php new file mode 100644 index 000000000..7143cb2d8 --- /dev/null +++ b/modules/backend/models/AccessLog.php @@ -0,0 +1,38 @@ + ['Backend\Models\User'] + ]; + + /** + * Creates a log record + * @param Backend\Models\User $user Admin user + * @return self + */ + public static function add($user) + { + $record = new static; + $record->user = $user; + $record->ip_address = Request::getClientIp(); + $record->save(); + + return $record; + } + +} \ No newline at end of file diff --git a/modules/backend/models/accesslog/columns.yaml b/modules/backend/models/accesslog/columns.yaml new file mode 100644 index 000000000..f02dc6fff --- /dev/null +++ b/modules/backend/models/accesslog/columns.yaml @@ -0,0 +1,32 @@ +# =================================== +# Column Definitions +# =================================== + +columns: + created_at: + label: Date & Time + searchable: yes + + login: + relation: user + select: @login + searchable: yes + + ip_address: + label: IP Address + searchable: yes + + first_name: + relation: user + select: @first_name + searchable: yes + + last_name: + relation: user + select: @first_name + searchable: yes + + email: + relation: user + select: @email + searchable: yes \ No newline at end of file diff --git a/modules/cms/database/migrations/2014_10_01_000001_Db_Cms_Error_Log.php b/modules/cms/database/migrations/2014_10_01_000001_Db_Cms_Error_Log.php new file mode 100644 index 000000000..171a0b8ae --- /dev/null +++ b/modules/cms/database/migrations/2014_10_01_000001_Db_Cms_Error_Log.php @@ -0,0 +1,27 @@ +engine = 'InnoDB'; + $table->increments('id'); + $table->string('url')->nullable(); + $table->string('referer')->nullable(); + $table->integer('count')->default(0); + $table->timestamps(); + }); + } + + public function down() + { + Schema::dropIfExists('cms_error_log'); + } + +} diff --git a/modules/cms/models/ErrorLog.php b/modules/cms/models/ErrorLog.php new file mode 100644 index 000000000..7b9560dfe --- /dev/null +++ b/modules/cms/models/ErrorLog.php @@ -0,0 +1,44 @@ + Request::fullUrl(), + 'referer' => Request::header('referer'), + ]); + + if (!$record->exists) { + $record->count = 1; + $record->save(); + } + else { + $record->increment('count'); + } + + return $record; + } + +} \ No newline at end of file diff --git a/modules/cms/models/errorlog/columns.yaml b/modules/cms/models/errorlog/columns.yaml new file mode 100644 index 000000000..b1cd76aa8 --- /dev/null +++ b/modules/cms/models/errorlog/columns.yaml @@ -0,0 +1,15 @@ +# =================================== +# Column Definitions +# =================================== + +columns: + url: + label: URL + searchable: yes + + referer: + label: Referer + searchable: yes + + count: + label: Counter diff --git a/modules/system/database/migrations/2014_10_01_000011_Db_System_Trace_Log.php b/modules/system/database/migrations/2014_10_01_000011_Db_System_Trace_Log.php new file mode 100644 index 000000000..1996f90b6 --- /dev/null +++ b/modules/system/database/migrations/2014_10_01_000011_Db_System_Trace_Log.php @@ -0,0 +1,27 @@ +engine = 'InnoDB'; + $table->increments('id'); + $table->string('level')->nullable()->index(); + $table->text('message')->nullable(); + $table->mediumtext('details')->nullable(); + $table->timestamps(); + }); + } + + public function down() + { + Schema::dropIfExists('system_trace_log'); + } + +} diff --git a/modules/system/models/TraceLog.php b/modules/system/models/TraceLog.php new file mode 100644 index 000000000..9fa862bbc --- /dev/null +++ b/modules/system/models/TraceLog.php @@ -0,0 +1,34 @@ +message = $message; + $record->level = $level; + $record->details = $details; + $record->save(); + + return $record; + } + +} \ No newline at end of file diff --git a/modules/system/models/tracelog/columns.yaml b/modules/system/models/tracelog/columns.yaml new file mode 100644 index 000000000..12fe1e890 --- /dev/null +++ b/modules/system/models/tracelog/columns.yaml @@ -0,0 +1,16 @@ +# =================================== +# Column Definitions +# =================================== + +columns: + id: + label: ID + searchable: yes + + created_at: + label: Date & Time + searchable: yes + + message: + label: Message + searchable: yes \ No newline at end of file