Professionally viewing Laravel logs is critical for identifying and debugging problems in your application. We can easily check our logs in local environments by saving them to local, but this is a time-consuming process in live environments.
In this section, I'll show you packages that will provide you with a graphical user interface that will allow you to easily check all of our logs, such as errors, warnings, and debug messages. From there, we can also clear / delete our log files. Daily logs are preferable because they make it easier to trace logs.
Let's look at how we can incorporate that package into our existing Laravel application.
It is recommended to use the _opcodesio _ package for Laravel running on PHP 8 and higher.
To use composer to install the package, type
composer require opcodesio/log-viewer.
After installing the package, run
php artisan log-viewer:publish to publish the front-end assets.
Once installed, you will be able to access Log Viewer directly from your browser.
By default, the application is available at:
It is recommended to use the
arcanedev package for Laravel running on PHP 7 and lower.
You can install this package using Composer by issuing the following command:
composer require arcanedev/log-viewer:x.x, where
x.x is the compatible version for your Laravel version.
composer require arcanedev/log-viewer for risk takes like me
This for the version you are sure of
composer require arcanedev/log-viewer:~4.7.0 for Laravel 5.8
composer require arcanedev/log-viewer:~4.6.0 for Laravel 5.7
composer require arcanedev/log-viewer:~4.5.0 for Laravel 5.6
composer require arcanedev/log-viewer:~4.4.0 for Laravel 5.5
composer require arcanedev/log-viewer:~4.3.0 for Laravel 5.4
composer require arcanedev/log-viewer:~4.2.0 for Laravel 5 > 5.3
Set this in your
APP_LOG=daily for Laravel 5.5 and below.
Run the following command to publish the configuration
php artisan log-viewer:publish
join(): Passing glue string after array is deprecated might appear. If you want to view the log according to the date at
http://your-project/log-viewer/logs/2023-07-30 you may receive a 504 Error or a 503 Error, depending on whether the debug mode is enabled in your
Go to your project directory locate
join(log_styler()->toHighlight(), '|') and replace with
Enjoy the rest of your day as a programmer