:dromedary_camel: Laravel log viewer

Overview

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\LogViewerController@index');

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', 'LogViewerController@index');
});

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.

Comments
  • Creating a  array that content  all the

    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)

    opened by elminson 16
  • Instruction not working for Lumen 5.3

    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

    opened by chmdznr 13
  • InvalidArgumentException in compiled.php line 12896: No hint path defined for [laravel-log-viewer]

    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.

    help wanted 
    opened by ravaboard 13
  • Class Rap2hpoutre\LaravelLogViewer\LogViewerController does not exist

    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.

    bug 
    opened by raymondTheDev 12
  • support for laravel daily logs

    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

    opened by djunehor 12
  • Request: AJAX viewing

    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

    enhancement 
    opened by judgej 12
  • Live Stream Log

    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.

    enhancement 
    opened by CWSpear 12
  • Daily storage logs not working for lumen 5.5.*.

    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.

    bug 
    opened by serdarsaygili 11
  • Class 'Crypt' not found (View: log.blade.php)

    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', 'LogViewerController@index');
    });
    

    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.

    bug 
    opened by mhousser 11
  • Multiple Log View Locations

    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.

    opened by Nowi5 9
  • vendor:publish doesn't publish anything

    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.

    bug 
    opened by akoepcke 9
  • This page isn’t working

    This page isn’t working

    this package is work fine in local but when I move to the host I get this error

    This page isn’t working xxxxx.com is currently unable to handle this request. HTTP ERROR 500

    can anyone help me pls ?

    opened by obadaaaaaah 0
  • Level keyword inside log entry results in new log entry in log viewer

    Level keyword inside log entry results in new log entry in log viewer

    When a log entry contains a level keyword like "failed" and a colon afterwards, an additional log entry with everything after the keyword + colon gets shown in the log viewer.

    Example: [2022-11-13 13:13:33] local.WARNING: Request failed: reason test

    Reproducable with: Log::warning("Request failed: reason test");

    Gets shown as: image

    opened by bendix-dev 0
  • Simplify regex matching function greatly

    Simplify regex matching function greatly

    Initially I encountered an issue where logging throw new \Exception('failed: test'); would result in the code recognizing 2 log inputs (because of the "failed" word). After trying to debug the issue I found that the whole pattern matching was written very inefficiently so I cleaned up that code and improved the algorithm to a more stable solution, which matches using a much more straightforward technique:

    • All log entries start with a date part (e.g. [2022-09-16 13:19:40]) up until the next occurrence of any such date string, indicating a new log entry has been encountered
    • This log entry is then divided into a heading and a stacktrace, simply using a separation on the first linebreak \n (which seems to be the default for all monolog entries)

    All code should still work for PHP 5.4 (although I havent tested that outdated dependency)

    opened by bert-w 0
  • basename(): Passing null to parameter #1

    basename(): Passing null to parameter #1

    Laravel: 9.27.0 laravel-log-viewer: 2.2.0 PHP 8.1.7

    basename(): Passing null to parameter #1 ($path) of type string is deprecated in /Users/rajjanorkar/Projects/myproject/vendor/rap2hpoutre/laravel-log-viewer/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php on line 141

    I believe this only happens when i delete all log files.

    opened by rajpt 0
  • Can not to artisan optimize:clear to log.blade.php

    Can not to artisan optimize:clear to log.blade.php

    When I exported log.blade.php to views. After that, I ran artisan optimize:clear and errors.

    Illuminate\\Contracts\\Container\\BindingResolutionException: Target class [view] does not exist. in /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php:877

    Please help me. Thank you so much!

    opened by tieutantan 0
Releases(v2.2.0)
Owner
Raphaël Huchet
Tinkering @ beta.gouv.fr & fabrique.social.gouv.fr. Stodgy mixture of Rust, JS, PHP, Forth, SQL, GFA Basic, music and more.
Raphaël Huchet
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

Galahad 301 Dec 26, 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

Marcel Pociot 923 Dec 16, 2022
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

Barry vd. Heuvel 14.8k Jan 9, 2023
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

Facade 2k Jan 1, 2023
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

Recca Tsai 383 Dec 6, 2022
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

The Laravel Framework 4.4k Dec 27, 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

Tideways 7 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.

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

Pavel Buchnev 310 Jan 2, 2023
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

Buggregator 311 Jan 4, 2023
: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

ARCANEDEV 2.3k Dec 30, 2022
OPcodes's Log Viewer is a perfect companion for your Laravel app

Log Viewer Easy-to-use, fast, and beautiful Features | Installation | Configuration | Authorization | Troubleshooting | Credits OPcodes's Log Viewer i

null 2.2k Jan 3, 2023
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

Dieter Coopman 196 Dec 28, 2022
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

null 9 Dec 14, 2022
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.

Anthony Rappa 540 Jan 5, 2023
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

hack4lx 4 Nov 25, 2022
PHP based Markdown documentation viewer

PHP based viewer for Markdown files, to view them with fenced code highlighting and navigation.

null 5 Dec 9, 2022
A Simple & Beautiful Pluggable Exception Viewer for FilamentPHP's Admin Panel

Filament Exception Viewer A Simple & Beautiful Exception Viewer for FilamentPHP's Admin Panel Installation You can install the package via composer: c

Bezhan Salleh 33 Dec 23, 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

Phalcon Orphanage 10 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. Requirements php >= 7.4 Laravel version >= 6.0 Installation composer

Sagar 6 Aug 25, 2022
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

Spatie 4.6k Jan 7, 2023