Laravel Log Viewer using LogViewer Package in Laravel 5.6

Hi, In this post we are going to know about Laravel Log Viewer using LogViewer Package in Laravel 5.6. As default Laravel Framework have a log file and it always keeps all runtime error & exception like Query error, URL not defined properly, Database exceptions Ect. Usually, it keeps all errors in single file with full error log details and it also very hard to view and analyze what error raised in it. And also laravel keeps all error log in a single file by default. For avoiding and simplifying this process Laravel has a new package that is LogViewer.

This package reduces our work to analyze and fix runtime error in our laravel application. It also helps us to make it a better web application. In this post, we are using LogViewer package to read error logs in a better way of a day to day log file. After setup this package into our Laravel application we can easily control real-time error logs and issue to improve our application. This package will generate log file based on day to day manner to control errors in our applications. A LogViewer package will generate log file when an error raises in a real-time app.

Step 1: Install Laravel

Here, we need new Laravel application for Laravel Log Viewer using LogViewer Package and demonstration. the following command helps to create a new application.

Step 2: Install Package

In this step, we have to download arcanedev/log-viewer package goto your command and run the following command

Step 3: Make configuration for the application

This step, we need to configure package provider in config/app.php file and add following service provider.

Step 4: Publish the Config Package

Here we are going to publish the install package with a help of the following command. Here we publish the package with a common command if any issue arises while public we can use –force key to publish force. If we need to publish with config file details only means we use –tag=config key. Another option is to publish with many languages means use –tag=lang key. It provides many language folders under resource/view folder.

Step 5: Config .env file

Using environment (.env) file we can config base and required a key for our application. In this now we can add LOG_CHANNEL key for generating log file daily basic.

Step 6: Checking the package status

In this, we can check the weather everything installed and configured right manner.

Error arrive in package – Check weather logging.php file created in config folder. Particular file present means just create a file with following details in name of logging.php under config folder.

Just remove the single laravel.log file in storage/log folder.

Step 7: Test and demonstrate the application

That’s it just demonstrates the application using the following URL

 

Learn Infinity

Learn Infinity is the most famous Programming & Web Development blog. Our principal is to provide the best online tutorial on web development. We execute the best tutorials for web experts this will help developers, programmers, freelancers and proving free resource you can download or preview the tutorials.

Leave a Reply

Your email address will not be published.

Back to top