1. Installation & Setup

March 17, 2024 ยท View on GitHub

Table of contents

  1. Installation and Setup
  2. Configuration
  3. Usage

Application Requirements

LogViewer support only the daily log channel, so make sure that the LOG_CHANNEL is set to daily instead of stack in your .env file.

For Laravel 5.5 and below, set this in your .env file

APP_LOG=daily

Laravel uses the Monolog PHP logging library. This gives you a variety of powerful log handlers/formatters to utilize.

Version Compatibility

LaravelLogViewer
![Laravel v11.x][laravel_11_x]![LogViewer v11.x][log_viewer_11_x]
![Laravel v9.x][laravel_10_x]![LogViewer v10.x][log_viewer_10_x]
Laravel v9.xLogViewer v9.x
Laravel v8.xLogViewer v8.x
Laravel v7.xLogViewer v7.x
Laravel v6.xLogViewer v5.x
Laravel v5.8LogViewer v4.7.x
Laravel v5.7LogViewer v4.6.x
Laravel v5.6LogViewer v4.5.x
Laravel v5.5LogViewer v4.4.x
Laravel v5.4LogViewer v4.3.x
Laravel v5.3LogViewer v4.2.x
Laravel v5.2LogViewer v4.2.x
Laravel v5.1LogViewer v4.2.x
Laravel v5.0LogViewer v4.2.x

Composer

You can install this package via Composer by running this command: composer require arcanedev/log-viewer:{x.x} where x.x is the version compatible with your laravel's version.

E.g composer require arcanedev/log-viewer:~4.6.0 for Laravel v5.7.

See the Version compatibility table above to choose the correct version.

Laravel

Setup

NOTE : The package will automatically register itself if you're using Laravel >= v5.5, so you can skip this section.

Once the package is installed, you can register the service provider in config/app.php in the providers array:

'providers' => [
    ...
    Arcanedev\LogViewer\LogViewerServiceProvider::class,
],

No need to register the LogViewer facade, it's done automagically.

Important Note:

For Laravel 8.x and above, you need to match the pagination styling with LogViewer template. The default pagination uses tailwindcss as default styling.

Artisan commands

To publish the config and translations files, run this command:

php artisan log-viewer:publish
To force publishing
php artisan log-viewer:publish --force
Publishing the config only
php artisan log-viewer:publish --tag=config

To force publishing add --force flag.

Publishing the translations only
php artisan log-viewer:publish --tag=translations

To force publishing add --force flag.

Application requirements & log files check

php artisan log-viewer:check

Clear all generated log files

php artisan log-viewer:clear

DONE !

Go to http://{your-project}/log-viewer (See the Configuration page to change the uri and other stuff).