Laravel Logs Viewer Integration

  • 01-11-2022
  • 1104
  • Laravel 9
  • Haresh Chauhan

Install Laravel log viewer, This post will help you to install laravel how to install laravel log viewer via composer. This is very simple to install for any developer laravel log viewer.

composer requires rap2hpoutre/laravel-log-viewer, using composer we will install laravel log viewer. This package will help us to look at a very pretty view of the application and all the logs and errors. Even you can also customize the log viewer structure according to your wants.

Preview :

image

Install via composer laravel log viewer package using the below-provided command in your project command prompt. This command installs a log view dependency in the project. It will take some time to install, as your mac sees in the command prompt process. It downloads some dependency files from the internet and installs them in the application.

composer require rap2hpoutre/laravel-log-viewer

Now we will add a service provider to config/app.php in the provider section.

Rap2hpoutre\LaravelLogViewer\LaravelLogViewerServiceProvider::class,

Now Add a route in your web routes file routes/web.php

Route::get('logs', [\Rap2hpoutre\LaravelLogViewer\LogViewerController::class, 'index']);

Install (Lumen)

Install the package via composer, use provided command.

composer require rap2hpoutre/laravel-log-viewer

Add the below-provided line in your bootstrap/app.php file:

$app->register(\Rap2hpoutre\LaravelLogViewer\LaravelLogViewerServiceProvider::class);

Now set a namespace in the app/Http/routes.php file

$router->group(['namespace' => '\Rap2hpoutre\LaravelLogViewer'], function() use ($router) {
     $router->get('logs', 'LogViewerController@index');
});

Advance Setting

If you want to customize your log view design and anything else, first you publish log.blade.php into /resources/views/vendor/laravel-log-viewer/ for view customization, use provided line in your command prompt.

php artisan vendor:publish \
--provider="Rap2hpoutre\LaravelLogViewer\LaravelLogViewerServiceProvider" \
--tag=views
Edit Setting Configuration

Firstly, we will Publish the logviewer.php configuration file into /config/ for configuration customization, use provided line in your project terminal and it will publish itself. Then after you can very easily config your file.

php artisan vendor:publish \
--provider="Rap2hpoutre\LaravelLogViewer\LaravelLogViewerServiceProvider"
Troubleshooting :

If you are facing any problem, maybe because of a cache, clear your config cache and check after.

php artisan config:clear

Laravel Carbon diffforhumans() With Parameters Examples

How To Change The Views/Blade File Path In Laravel

Looping Variable Laravel Blade File - $loop

Sendgrid Email Send Tutorial Laravel/PHP/cURL Example

Laravel Pagination With Search Filter Not Working

Laravel Remove index.php From URL


We always thanks to you for reading our blogs.


dharmesh-image

Dharmesh Chauhan

(Swapinfoway Founder)

Hello Sir, We are brothers origin from Gujarat India, Fullstack developers working together since 2016. We have lots of skills in web development in different technologies here I mention PHP, Laravel, Javascript, Vuejs, Ajax, API, Payment Gateway Integration, Database, HTML5, CSS3, and Server Administration. So you need our service Please Contact Us

haresh-image

Haresh Chauhan

(Co-Founder)


We Are Also Recommending You :