Overview of LogViewer
master5.x through 11.x and can be used both as a UI dashboard and as an API.repository·master·Indexed 25 days ago
https://github.com/arcanedev/logviewerA Laravel package providing a UI and API for managing, viewing, paginating, filtering, downloading, and deleting application log files. Compatible with Laravel versions 5.x through 11.x, it supports the daily log channel, multiple localizations, and customizable themes (Bootstrap 3 and 4). Includes Artisan commands for checking requirements, clearing logs, and viewing statistics, as well as Log and LogCollection entities for programmatic access to log data.
5.x through 11.x and can be used both as a UI dashboard and as an API.LogViewer provides several out-of-the-box capabilities for log management:
Install the package using Composer. You must select a version compatible with your Laravel installation based on the version compatibility table in the documentation.
Use the syntax composer require arcanedev/log-viewer:{x.x} where x.x is the compatible version.
composer require arcanedev/log-viewer:~4.6.0By default, you can access the LogViewer interface at:
http://{your-project}/log-viewer
You can change the URI in the package configuration.
If you are using Laravel version < 5.5, you must manually register the service provider in the providers array within config/app.php. If you are using Laravel >= 5.5, this step is handled automatically and can be skipped.
Note: You do not need to register the LogViewer facade; it is registered automatically.
'providers' => [
...
Arcanedev\LogViewer\LogViewerServiceProvider::class,
],LogViewer only supports the daily log channel. You must ensure your Laravel application is configured to use this channel in your .env file.
For Laravel versions >= 5.5, set:
LOG_CHANNEL=daily
For Laravel versions <= 5.5, set:
APP_LOG=daily
Use the storage-path key to define the directory where your log files are located. By default, it uses Laravel's storage_path('logs').
return [
'storage-path' => storage_path('logs'),
];Use the per-page key to define how many log entries are displayed on a single page.
return [
'per-page' => 30,
];Define the naming convention for your log files using the pattern array. This includes a prefix, a date regex pattern, and an extension.
It is recommended to use the constants provided by Arcanedev\LogViewer\Contracts\Utilities\Filesystem for consistency.
use Arcanedev\LogViewer\Contracts\Utilities\Filesystem;
return [
'pattern' => [
'prefix' => Filesystem::PATTERN_PREFIX, // 'laravel-'
'date' => Filesystem::PATTERN_DATE, // '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]'
'extension' => Filesystem::PATTERN_EXTENSION, // '.log'
],
];Select a supported theme using the theme key. Supported themes are bootstrap-3 and bootstrap-4.
You can create a custom theme by adding a new folder to the views directory and specifying its name in this configuration.
return [
'theme' => 'bootstrap-4',
];The colors.levels array allows you to map specific log levels to hex color codes for the UI.
return [
'colors' => [
'levels' => [
'empty' => '#D1D1D1',
'all' => '#8A8A8A',
'emergency' => '#B71C1C',
'alert' => '#D32F2F',
'critical' => '#F44336',
'error' => '#FF5722',
'warning' => '#FF9100',
'notice' => '#4CAF50',
'info' => '#1976D2',
'debug' => '#90CAF9',
],
],
];The download array allows you to specify the prefix and extension used when downloading log files.
return [
'download' => [
'prefix' => 'laravel-',
'extension' => 'log',
],
];