:dromedary_camel: Laravel log viewer

Last update: May 24, 2022

Laravel log viewer

Packagist Packagist Packagist Scrutinizer Code Quality Build Status Codacy Badge Author

TL;DR

Log Viewer for Laravel 5, 6, 7 & 8 (still compatible with 4.2 too) and Lumen. Install with composer, create a route to LogViewerController. No public assets, no vendor routes, works with and/or without log rotate. Inspired by Micheal Mand's Laravel 4 log viewer (works only with laravel 4.1)

What ?

Small log viewer for laravel. Looks like this:

capture d ecran 2014-12-01 a 10 37 18

Install (Laravel)

Install via composer

composer require rap2hpoutre/laravel-log-viewer

Add Service Provider to config/app.php in providers section

Rap2hpoutre\LaravelLogViewer\LaravelLogViewerServiceProvider::class,

Add a route in your web routes file:

Route::get('logs', '\Rap2hpoutre\LaravelLogViewer\[email protected]');

Go to http://myapp/logs or some other route

Install (Lumen)

Install via composer

composer require rap2hpoutre/laravel-log-viewer

Add the following in bootstrap/app.php:

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

Explicitly set the namespace in app/Http/routes.php:

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

Advanced usage

Customize view

Publish log.blade.php into /resources/views/vendor/laravel-log-viewer/ for view customization:

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

Edit configuration

Publish logviewer.php configuration file into /config/ for configuration customization:

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

Troubleshooting

If you got a InvalidArgumentException in FileViewFinder.php error, it may be a problem with config caching. Double check installation, then run php artisan config:clear.

GitHub

https://github.com/rap2hpoutre/laravel-log-viewer
Comments
  • 1. Creating a array that content all the "pattern" for the preg_match_all and preg_match

    This allows if in the feature we want to create a new featured that include patterns we cant add this for the best readability (some patterns get really complicated)

    Reviewed by elminson at 2018-07-16 15:05
  • 2. Instruction not working for Lumen 5.3

    Got this error after following the installation instruction for Lumen: Class App\Http\Controllers\Rap2hpoutre\LaravelLogViewer\LogViewerController does not exist

    FYI, the route's settings file in Lumen 5.3 is on: routes/web.php

    Reviewed by chmdznr at 2016-12-31 22:12
  • 3. InvalidArgumentException in compiled.php line 12896: No hint path defined for [laravel-log-viewer]

    Im a newbie with laravel, but did all as in the README of this package and when I go to http://myapp/logs I get this error:

    InvalidArgumentException in compiled.php line 12896: No hint path defined for [laravel-log-viewer]

    Any ideas on why this happens?

    Thanks.

    Reviewed by ravaboard at 2015-03-24 13:08
  • 4. Class Rap2hpoutre\LaravelLogViewer\LogViewerController does not exist

    Just did a composer update on a Laravel project and now it's showing.

    Class Rap2hpoutre\LaravelLogViewer\LogViewerController does not exist

    This was working fine before the composer update

    Thank you.

    Reviewed by raymondTheDev at 2020-04-22 22:51
  • 5. support for laravel daily logs

    In response to issue #202 where the package doesn't detect other log files deep in the year and month folders. I modified the package to generate an array of the directory structure with the files therein so user can click on any file to view logs. Capture

    Reviewed by djunehor at 2019-10-16 21:50
  • 6. Request: AJAX viewing

    Instead of loading an entire logfile in one go, can we use AJAX to fetch just the rows that are needed? Datatable is really good at this, and it is surprisingly easy to do with a package to handle the server side, such as https://github.com/yajra/laravel-datatables

    Reviewed by judgej at 2015-09-12 19:52
  • 7. Live Stream Log

    It would be awesome if the page would automatically update when there are new items to show.

    Ideally, this would be done with sockets. I don't have a lot of experience with sockets in PHP, but I've found it's not nearly as easy as say, Node and socket.io.

    I'm really not sure how viable this is in pure PHP (i.e. I don't know that you can really watch for file changes in realtime with PHP), but it would be a super useful feature! Definitely possible and not terrible difficult with Node, but that'd require another dependency.

    Just wanted to throw this out there and see if anyone else had any ideas.

    Reviewed by CWSpear at 2015-04-21 19:08
  • 8. Daily storage logs not working for lumen 5.5.*.

    Encrypter.php -> getJsonPayload waits payload to be json_decodeable bash64 encrypted data. But the payload comes as base64 encoded string of log file name (lumen-2018-04-19.log). So selecting log file throws an invalid payload exception.

    Reviewed by serdarsaygili at 2018-04-19 09:42
  • 9. Class 'Crypt' not found (View: log.blade.php)

    Updated to latest 0.13, and using Lumen 5.6 latest. (Lumen - not Laravel.)

    Setup has always worked. Now whenever we hit our /logs endpoint, we get the following:

    Class 'Crypt' not found (View: \/var\/www\/server\/vendor\/rap2hpoutre\/laravel-log-viewer\/src\/views\/log.blade.php

    Our web.php is as required:

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

    And yes we have the appropriate line in app.php:

    // Lumen.log viewer.
    $app->register(\Rap2hpoutre\LaravelLogViewer\LaravelLogViewerServiceProvider::class);
    

    Simply cannot get past this error. I don't know if it's related to the Lumen upgrade to 5.6, the upgrade to 0.13 for the log viewer itself, or a combination of the two.

    Please help. Thanks.

    Reviewed by mhousser at 2018-03-15 21:46
  • 10. Multiple Log View Locations

    Hi all,

    I hope you are doing fine. Do we have any option to define multiple locations e.g. via config setting storage_path to array = ['/location1', '/other/location2']?

    Thank you.

    Reviewed by Nowi5 at 2018-07-23 15:46
  • 11. vendor:publish doesn't publish anything

    Hey, as the title suggests, vendor:publish doesn't publish a thing. It doesn't give me an error, just tells me that publishing is complete though. If I manually copy the log.blade.php into views/vendor/laravel-log-viewer and edit that file, then I can see my changes.

    Reviewed by akoepcke at 2017-07-04 09:38
  • 12. Wrong logs path

    Hello,

    I wanted to try your package but all the logs paths seems to be wrong, for example when I click on the link for today's logs:

    No such log file: /var/www/html/storage/logs//var/www/html/storage/logs\laravel-2022-04-16.log
    
    • The logs path appears twice
    • There's a backslash instead of a slash before the filename

    Do you know if this is something that can come from my configuration?

    Thanks for your help!

    Reviewed by WillyReyno at 2022-04-16 13:31
  • 13. Is this usable with spatie permissions (role specifically?)

    I've been trying to get the middleware working with role:Admin and it just returns 403 User not logged in when going to the log. Has anyone else used this with spatie permissions package and using the role middleware to limit access?

    Reviewed by shaneburrell at 2022-03-30 19:40
  • 14. Left hand file name panel sorting broken

    After upgrading to the latest version I noticed that the list of log files on the left that has previously been sorted by filename were now seemingly random (or being sorted by some other parameter)

    is there a way to make this go back to sorting by filename please?

    many thanks,

    kris

    Reviewed by krismanning at 2022-02-21 08:04
  • 15. Search function pattern only include $entry->header ~ should it include others as well?

    Hi,

    Firstly, just wanna say love this lightweight project. Second, I just want to ask whether this could be a feature in the next push? the search function only filter checks for $entry->headers. Can it also include the context && stack as well? Would love to know your input on your original design ~ cheers.

    image

    Reviewed by ejaytkm at 2021-11-15 07:57
Laravel Dumper - Improve the default output of dump() and dd() in Laravel projects

Laravel Dumper Improve the default output of dump() and dd() in Laravel projects. Improves the default dump behavior for many core Laravel objects, in

May 25, 2022
Generate Laravel test factories from your existing models

Laravel Test Factory Generator php artisan generate:model-factory This package will generate factories from your existing models so you can get starte

May 15, 2022
Laravel Debugbar (Integrates PHP Debug Bar)
Laravel Debugbar (Integrates PHP Debug Bar)

Laravel Debugbar This is a package to integrate PHP Debug Bar with Laravel. It includes a ServiceProvider to register the debugbar and attach it to th

May 24, 2022
A beautiful error page for Laravel apps
A beautiful error page for Laravel apps

Ignition: a beautiful error page for Laravel apps Ignition is a beautiful and customizable error page for Laravel applications running on Laravel 5.5

May 13, 2022
A Laravel Package to integrate Nette Tracy Debugger
A Laravel Package to integrate Nette Tracy Debugger

Nette Tracy for Laravel 5 Better Laravel Exception Handler Features Visualization of errors and exceptions Debugger Bar (ajax support @v1.5.6) Excepti

May 3, 2022
An elegant debug assistant for the Laravel framework.
An elegant debug assistant for the Laravel framework.

Introduction Laravel Telescope is an elegant debug assistant for the Laravel framework. Telescope provides insight into the requests coming into your

May 19, 2022
This package connects a Laravel Octance application with Tideways for PHP Monitoring, Profiling and Exception Tracking.

Tideways Middleware for Laravel Octane This package connects a Laravel Octance application with Tideways for PHP Monitoring, Profiling and Exception T

Jan 6, 2022
Ray server is a beautiful, lightweight php app build on Laravel that helps you debug your app. It runs without installation on multiple platforms.
Ray server is a beautiful, lightweight php app build on Laravel that helps you debug your app. It runs without installation on multiple platforms.

RayServer is a beautiful, lightweight web server built on Laravel and VueJs that helps debugging your app. It runs without installation on multiple platforms.

May 16, 2022
Buggregator is a beautiful, lightweight web server built on Laravel and VueJs that helps debugging your app.
Buggregator is a beautiful, lightweight web server built on Laravel and VueJs that helps debugging your app.

A server for debugging more than just Laravel applications. Buggregator is a beautiful, lightweight web server built on Laravel and VueJs that helps d

May 16, 2022
:page_with_curl: Provides a log viewer for Laravel
:page_with_curl: Provides a log viewer for Laravel

LogViewer By ARCANEDEV© This package allows you to manage and keep track of each one of your log files. NOTE: You can also use LogViewer as an API. Of

May 26, 2022
A Laravel package to output a specific sql to your favourite debugging tool. The supported log output is Laravel Telescope, Laravel Log, Ray, Clockwork, Laravel Debugbar and your browser.
A Laravel package to output a specific sql to your favourite debugging tool. The supported log output is Laravel Telescope, Laravel Log, Ray, Clockwork, Laravel Debugbar and your browser.

Laravel showsql A Laravel package to output a specific sql to your favourite debugging tool, your browser or your log file. Use case You often want to

Apr 15, 2022
Robot increase telegram post 👁‍🗨Telegram Fake Posts Viewer👁‍🗨
Robot increase telegram post 👁‍🗨Telegram Fake Posts Viewer👁‍🗨

Program Features - ?? Very and stylish design. - ?? It has glass buttons. - ?? Has a professional management panel. - ?? Has a user area. - ?? Free di

Nov 15, 2021
Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app
Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app

Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app

Apr 20, 2022
Laravel Authentication Log is a package Log user authentication details and send new device notifications.
Laravel Authentication Log is a package Log user authentication details and send new device notifications.

Laravel Authentication Log is a package which tracks your user's authentication information such as login/logout time, IP, Browser, Location, etc. as well as sends out notifications via mail, slack, or sms for new devices and failed logins.

May 14, 2022
Sends log messages to the Logentries log management service

Phalcon Logentries Phalcon library to connect and make log entries using Logentries. You can adapt it to your own needs or improve it if you want. Ple

Apr 15, 2019
Laravel Logable is a simple way to log http request in your Laravel application.
 Laravel Logable is a simple way to log http request in your Laravel application.

Laravel Logable is a simple way to log http request in your Laravel application. Requirements php >= 7.4 Laravel version >= 6.0 Installation composer

Feb 5, 2022
Log activity inside your Laravel app
Log activity inside your Laravel app

Log activity inside your Laravel app The spatie/laravel-activitylog package provides easy to use functions to log the activities of the users of your

May 24, 2022
Record the change log from models in Laravel

This package will help you understand changes in your Eloquent models, by providing information about possible discrepancies and anomalies that could

May 18, 2022
This Package helps you in laravel application to log all desired activity for each request from request entry point to generate response at a single snapshot.

Laravel Scenario Logger This Package helps you in laravel application to log all desired activity for each request from request entry point to generat

Sep 27, 2021
Log Laravel application request and response with a unique ID for easy debugging
Log Laravel application request and response with a unique ID for easy debugging

Flexible and extendable logging of Laravel application request and responses Zero configuration logging of Requests and Responses to database or custo

Jan 25, 2022