Hello developers, In this tutorial, I will explain to you how to do Laravel Log Viewer Example. We will use arcanedev/log-viewer for log viewer in Laravel. In this tutorial, I will show you how you can view and analyze the logs in Laravel. Laravel log viewer is a package to quickly view your log files from a browser. The installation is as simple as requiring the composer package. The Logging Dashboard contains emergency,alert,critical,error,warning,notice,info,debug. If any error, warning, an alert occurs that store in laravel log file. It is store in error format; we can execute it readable format and know how much error including a description, so we can fix it and make it a better web application. This package provides the feature like :
- A great Log viewer API.
5.0 | 5.1 | 5.2 | 5.3 | 5.4 | 5.5 | 5.6are supported.
- Ready to use (Views, Routes, controllers … Out of the box) [Note: No need to publish assets]
- View, paginate, filter, download and delete logs.
- Load a custom logs storage path.
- Localized log levels.
- Logs menu/tree generator.
- Grouped logs by dates and levels.
- Customized log levels icons (font awesome by default).
- Works great with big logs !!
- Well documented package (IDE Friendly).
- Well tested (100% code coverage with maximum code quality).
Laravel Log Viewer Example
First, we install Log viewer Package in our Project.
#1: Install Log Viewer Package
We will install arcanedev/log-viewer package by hit following command in cmd.
composer require arcanedev/log-viewer
#2: Register Service Provider
Find the providers in config >> app.php file and register the LogViewerServiceProvider.
'providers' => [ ... Arcanedev\LogViewer\LogViewerServiceProvider::class, ],
#3: Configure Log Viewer Package
Publish config and translations file
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
Publishing the translations only
php artisan log-viewer:publish --tag=lang
Application requirements & log files check
php artisan log-viewer:check
By default, laravel provide a stack value in LOG_CHANNEL variable in the .env file. LogViewer support only the daily log channel, so make assured that the LOG_CHANNEL is set to daily instead of a stack in your .env file.
// .env LOG_CHANNEL=daily
Start Laravel Development Server by the following command in cmd.
php artisan serve
Type Below URL on your browser
At last, our Laravel Log Viewer Example is over.