A simple and beautiful laravel log reader

Overview
Comments
  • allow custom middleware in config

    allow custom middleware in config

    My default auth guard is api. I need to be able to assign a auth:web middleware so I can use this package. So this PR will give the user flexibility for middlewares.

    A little backstory... I also ran into this problem in https://github.com/laravel/horizon (which really similar with this package), the solution was just like what I mentioned above. Luckily Horizon has middleware in its config file.

    Anw, This is a really nice package!

    opened by rizkyarlin 6
  • No logs appear on the panel

    No logs appear on the panel

    so when I get to the url, everything is fine except that I have no logs at all. here's the layout of logs and proof that they exist

    here is logging details

    <?php
    
    use Monolog\Handler\StreamHandler;
    
    return [
    
        /*
        |--------------------------------------------------------------------------
        | Default Log Channel
        |--------------------------------------------------------------------------
        |
        | This option defines the default log channel that gets used when writing
        | messages to the logs. The name specified in this option should match
        | one of the channels defined in the "channels" configuration array.
        |
        */
    
        'default' => env('LOG_CHANNEL', 'stack'),
    
        /*
        |--------------------------------------------------------------------------
        | Log Channels
        |--------------------------------------------------------------------------
        |
        | Here you may configure the log channels for your application. Out of
        | the box, Laravel uses the Monolog PHP logging library. This gives
        | you a variety of powerful log handlers / formatters to utilize.
        |
        | Available Drivers: "single", "daily", "slack", "syslog",
        |                    "errorlog", "monolog",
        |                    "custom", "stack"
        |
        */
    
        'channels' => [
            'stack' => [
                'driver' => 'stack',
                'channels' => ['daily', 'syslog', 'errorlog'],
            ],
    
            'single' => [
                'driver' => 'single',
                'path' => storage_path('logs/laravel.log'),
                'level' => 'debug',
            ],
    
            'daily' => [
                'driver' => 'daily',
                'path' => storage_path('logs/' . php_sapi_name() . '/laravel.log'),
                'level' => 'debug',
                'days' => 7,
            ],
    
            'slack' => [
                'driver' => 'slack',
                'url' => env('LOG_SLACK_WEBHOOK_URL'),
                'username' => 'Laravel Log',
                'emoji' => ':boom:',
                'level' => 'critical',
            ],
    
            'stderr' => [
                'driver' => 'monolog',
                'handler' => StreamHandler::class,
                'with' => [
                    'stream' => 'php://stderr',
                ],
            ],
    
            'syslog' => [
                'driver' => 'syslog',
                'level' => 'error',
            ],
    
            'errorlog' => [
                'driver' => 'errorlog',
                'level' => 'error',
            ],
        ],
    
    ];
    
    opened by arthur798 6
  • Package customization error

    Package customization error

    Hello, thanks for the great package.

    After publishing the package with command php artisan vendor:publish --provider="Haruncpi\LaravelLogReader\ServiceProvider" --tag="config"

    and running composer dump-autoload

    The following error generated:

    > Illuminate\Foundation\ComposerScripts::postAutoloadDump
    > @php artisan package:discover --ansi
    
    In UrlGenerator.php line 120:
    Argument 2 passed to Illuminate\Routing\UrlGenerator::__construct() must be an instance of Illuminate\Http\Request, null given, called in <Laravel-rout-path>\vendor\laravel\framework\src\Illuminate\Routing\RoutingServiceProvider.php on line 68
    
    Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
    

    The full error log is the following:

    [2020-02-06 20:52:25] laravel.EMERGENCY: Unable to create configured logger. Using emergency logger. {"exception":"[object] (InvalidArgumentException(code: 0): Log [] is not defined. at [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Log\\LogManager.php:192)
    [stacktrace]
    #0 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Log\\LogManager.php(118): Illuminate\\Log\\LogManager->resolve(NULL)
    #1 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Log\\LogManager.php(98): Illuminate\\Log\\LogManager->get(NULL)
    #2 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Log\\LogManager.php(547): Illuminate\\Log\\LogManager->driver()
    #3 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Exceptions\\Handler.php(121): Illuminate\\Log\\LogManager->error('Argument 2 pass...', Array)
    #4 [--Laravel-rout-path--]\\app\\Exceptions\\Handler.php(37): Illuminate\\Foundation\\Exceptions\\Handler->report(Object(Symfony\\Component\\Debug\\Exception\\FatalThrowableError))
    #5 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Console\\Kernel.php(376): App\\Exceptions\\Handler->report(Object(Symfony\\Component\\Debug\\Exception\\FatalThrowableError))
    #6 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Console\\Kernel.php(141): Illuminate\\Foundation\\Console\\Kernel->reportException(Object(Symfony\\Component\\Debug\\Exception\\FatalThrowableError))
    #7 [--Laravel-rout-path--]\\artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
    #8 {main}
    "} 
    [2020-02-06 20:52:25] laravel.ERROR: Argument 2 passed to Illuminate\Routing\UrlGenerator::__construct() must be an instance of Illuminate\Http\Request, null given, called in [--Laravel-rout-path--]\vendor\laravel\framework\src\Illuminate\Routing\RoutingServiceProvider.php on line 68 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Argument 2 passed to Illuminate\\Routing\\UrlGenerator::__construct() must be an instance of Illuminate\\Http\\Request, null given, called in [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\RoutingServiceProvider.php on line 68 at [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\UrlGenerator.php:120)
    [stacktrace]
    #0 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\RoutingServiceProvider.php(68): Illuminate\\Routing\\UrlGenerator->__construct(Object(Illuminate\\Routing\\RouteCollection), NULL, NULL)
    #1 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php(799): Illuminate\\Routing\\RoutingServiceProvider->Illuminate\\Routing\\{closure}(Object(Illuminate\\Foundation\\Application), Array)
    #2 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php(681): Illuminate\\Container\\Container->build(Object(Closure))
    #3 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php(629): Illuminate\\Container\\Container->resolve('url', Array)
    #4 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Application.php(776): Illuminate\\Container\\Container->make('url', Array)
    #5 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\helpers.php(121): Illuminate\\Foundation\\Application->make('url', Array)
    #6 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\helpers.php(932): app('Illuminate\\\\Cont...')
    #7 [--Laravel-rout-path--]\\config\\laravel-log-reader.php(6): url('shopadmin')
    #8 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Bootstrap\\LoadConfiguration.php(72): require('C:\\\\xampp\\\\htdocs...')
    #9 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Bootstrap\\LoadConfiguration.php(39): Illuminate\\Foundation\\Bootstrap\\LoadConfiguration->loadConfigurationFiles(Object(Illuminate\\Foundation\\Application), Object(Illuminate\\Config\\Repository))
    #10 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Application.php(219): Illuminate\\Foundation\\Bootstrap\\LoadConfiguration->bootstrap(Object(Illuminate\\Foundation\\Application))
    #11 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Console\\Kernel.php(320): Illuminate\\Foundation\\Application->bootstrapWith(Array)
    #12 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Console\\Kernel.php(129): Illuminate\\Foundation\\Console\\Kernel->bootstrap()
    #13 [--Laravel-rout-path--]\\artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
    #14 {main}
    "} 
    

    The cause of the error is: error line 7 [--Laravel-rout-path--]\config\laravel-log-reader.php(6): url('shopadmin')

    Commenting out this 6th line from the \config\laravel-log-reader.php the issue is resolving. The issue is known: https://github.com/laravel/framework/issues/7671

    The url() Laravel helper is not for use in the any_config.php files.

    I suggest the change the package to do not use the url() helper function. In the \config\laravel-log-reader.php by my opinion enough to use a simple string like '/admin' or '/shopadmin', or a rout name, and convert it to url in the view,

    opened by trianity 4
  • [BUG] won't read custom log names

    [BUG] won't read custom log names

    If you change log file names in config/logging.php then this package won't be able to read the files.

    env

    LOG_CHANNEL=daily
    

    logging.php

    'daily' => [
      'driver' => 'daily',
      'path' => storage_path('logs/whatEver.log'),
      'level' => 'debug',
      'days' => 14,
    ],
    
    opened by robertnicjoo 2
  • Class 'App\Http\Controllers\Controller' not found

    Class 'App\Http\Controllers\Controller' not found

    <?php
    
     
    
    namespace Haruncpi\LaravelLogReader\Controllers;
    
     
    
    use App\Http\Controllers\Controller;
    
    use Haruncpi\LaravelLogReader\LaravelLogReader;
    
    use Illuminate\Http\Request;
    
    use Illuminate\Support\Facades\File;
    
     
    
    class LogReaderController extends Controller
    

    That is probably because the package doesn't respect custom namespace. Can we add support for that?

    opened by arthur798 2
  • How to view custom log files using Log Viewer in Laravel

    How to view custom log files using Log Viewer in Laravel

    for viewing log files. It works fine. But I also have other log files, how can I view them usig this viewer?

    I have on more log say: /storage/framework/logs/custom.log

    opened by theankitjais 1
  • Unable to write to log file

    Unable to write to log file

    This may be more of a Laravel issue, but I'm getting an error: The stream or file "/var/app/current/storage/logs/laravel-2021-05-18.log" could not be opened in append mode: failed to open stream: Permission denied Instead of the daily log file being created under the web user, it's being created under root user:

    drwxrwxrwx 2 webapp webapp 4.0K May 18 16:12 . drwxrwxrwx 5 webapp webapp 4.0K May 18 16:08 .. -rwxrwxrwx 1 webapp webapp 14 May 18 16:08 .gitignore -rw-r--r-- 1 root root 66K May 18 16:24 laravel-2021-05-18.log -rw-r--r-- 1 webapp webapp 0 May 18 16:11 laravel.log

    Is there any way to get the file to be created under webapp like all the other files?

    opened by DigitalIceChris 1
  • Customizeable views

    Customizeable views

    In order for package to be more flexible and wider used, ability to publish and customize blade templates is a must e.g. php artisan vendor:publish --provider="Haruncpi\LaravelLogReader\ServiceProvider" --tag="views"

    opened by liepumartins 1
  • No logs appear on the panel with error in logs

    No logs appear on the panel with error in logs

    There is nothin on the panel and Sentry throws an issue

    ErrorException
    Notice: Undefined offset: 0
    route | Haruncpi\LaravelLogReader\Controllers\LogReaderController@getLogs
    public/index.php at line 54
    
    $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
    $response = $kernel->handle(
        $request = Illuminate\Http\Request::capture()
    );
    $response->send();
    $kernel->terminate($request, $response);
    
    sql.query | select * from `users` where `id` = ? limit 1
    
    url http://homestead.test/admin/api/log-reader
    
    
    opened by nayre1 1
  • fix dtmatch offset

    fix dtmatch offset

    Hey this is a great looking package! UI and API options both are really what I need for consuming daily logs.

    I'm running into an issue getting the logs to load via the LaravelLogReader though,

    ErrorException: Undefined offset: 0 in file ~/Valet/mcot/vendor/haruncpi/laravel-log-reader/src/LaravelLogReader.php on line 34

    I added a simple check for the offset into the LaravelLogReader, and it is working locally for me.

    opened by indigoswann 1
  • Index page breaks when changing API route

    Index page breaks when changing API route

    Great package, very useful!

    One issue I found is if the API route changes in the config file, it no longer shows any logs. Seems to be due to hard coded routes in the index view

    if (date !== '' && date !== undefined) {
        url = '{{url('/admin/api/log-reader')}}?date=' + date
            } else {
        url = '{{url('/admin/api/log-reader')}}'
    }
    
    opened by alistairreynolds 1
  • Laravel 8 throw an error

    Laravel 8 throw an error

    the package depend on user model which is located in past version in app folder but not the directory is changed we need to edit the user-activity.php 'model' => [ 'user' => "App\Models\User" ],

    and vendor\haruncpi\laravel-user-activity\src\Controllers\ActivityController.php

    use App\Models\User; private $userInstance = "\App\Models\User";

    opened by Myassar-AWJ 0
  • JS error when viewing log-reader page

    JS error when viewing log-reader page

    image There is a JS error, specifically angular-js error when visiting the log-reader page

    image There logging channel is set to already set to daily, as you can view in the screenshot above it already produced a daily log report

    Is there anything that I missed during the package installation?

    opened by afiqhamzah-wisb 0
  • Fixes #14 - Showing the full stack message

    Fixes #14 - Showing the full stack message

    Fixes #14 - If there's '\n' is present in message, shows the first line and adds button 'Show full stack' + I fixed filter by type as there was an error

    opened by Katenkka 0
Owner
Md.Harun-Ur-Rashid
Hi, this is Harun from Chittagong, Bangladesh. I am professionally full stack web developer.
Md.Harun-Ur-Rashid
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

Bilfeldt 37 Nov 6, 2022
Flexible and rock solid audit log tracking for CakePHP 3

AuditStash Plugin For CakePHP This plugin implements an "audit trail" for any of your Table classes in your application, that is, the ability of recor

José Lorenzo Rodríguez 68 Dec 15, 2022
DatabaseLog CakePHP plugin to log into DB instead of files. Better to filter and search.

CakePHP DatabaseLog Plugin DatabaseLog engine for CakePHP applications. This branch is for CakePHP 4.0+. See version map for details. Features Easy se

Mark Sch. 41 Jul 29, 2022
Remove messages from the error log that are from a certain folder

Error-Focus A package to stay focused on relevant entries in your error-log Scope This package allows you to declare folders that are not under your d

Andreas Heigl 7 Jul 25, 2022
An effective,fast,stable log extension for PHP

SeasLog An effective,fast,stable log extension for PHP @author Chitao.Gao [[email protected]] Documentation On php.net 中文文档 Synopsis Why use seaslog What

Neeke Gao 76 Sep 28, 2022
PHP logging library that is highly extendable and simple to use.

Analog - Minimal PHP logging library Copyright: (c) 2012-Present Johnny Broadway License: MIT A minimal PHP logging package based on the idea of using

Aband*nthecar 331 Dec 21, 2022
A simple database logger for all outgoing emails sent by Laravel website.

Laravel Email Database Log A simple database logger for all outgoing emails sent by Laravel website.

Shvets Group 136 Jan 4, 2023
A Simple Logging Class For PHP

KLogger: Simple Logging for PHP A project written by Kenny Katzgrau and Dan Horrigan. About KLogger is an easy-to-use PSR-3 compliant logging class fo

Kenny Katzgrau 964 Dec 11, 2022
Simple PHP Logger. Composer package

Basic PHP Logger ?? Simple logger. Composer package.

null 1 Jan 28, 2022
temperature-pi: a simple Raspberry Pi based temperature logger using a DS18B20 1-Wire digital temperature sensor, & a local sqlite database

temperature-pi temperature-pi is a simple Raspberry Pi based temperature logger using a DS18B20 1-Wire digital temperature sensor, & a local sqlite da

Ronan Guilloux 23 Dec 27, 2020
Capture and monitor detailed error logs with nice dashboard and UI

Capture and monitor detailed error logs with nice dashboard and UI Requirements Check Laravel 6 requirements Check Laravel 7 requirements Installation

Bugphix 107 Dec 12, 2022
Keep your laravel logs small and tidy.

Logs can get quite out of hand. This package helps save server space and keep your Laravel log files small.

Accent Interactive 73 Nov 14, 2022
Laravel logger is an activity event logger for your Laravel or Lumen application

Laravel logger is an activity event logger for your Laravel or Lumen application. It comes out the box with ready to use with dashboard to view your activity. Laravel logger can be added as a middleware or called through a trait. Easily have an Activity Log. This package is easily configurable and customizable. Supports Laravel 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 6, and 7+

Jeremy Kenedy 475 Dec 22, 2022
Sends your logs to files, sockets, inboxes, databases and various web services

Monolog - Logging for PHP Monolog sends your logs to files, sockets, inboxes, databases and various web services. See the complete list of handlers be

Jordi Boggiano 20.1k Jan 8, 2023
Paste, share and analyse Minecraft server logs

mclo.gs Paste, share & analyse your Minecraft server logs About The project mclo.gs was created in 2017 by the Aternos team after more than 4 years of

Aternos 99 Jan 3, 2023
Sends your logs to files, sockets, inboxes, databases and various web services

Monolog - Logging for PHP ⚠ This is the documentation for Monolog 3.x, if you are using older releases see the documentation for Monolog 2.x or Monolo

Jordi Boggiano 20.1k Jan 7, 2023
Robust, composite logger with filtering, formatting, and PSR-3 support

laminas-log ???? Русским гражданам Мы, участники Laminas, родились и живем в разных странах. У многих из нас есть друзья, родственники и коллеги как в

Laminas Project 27 Nov 24, 2022
This package is for centralized logging of multiple Laravel application into one connection.

Laralogs This package is for centralized logging of multiple Laravel application into one connection. Installation You can install the package via com

Remon 4 Apr 26, 2022
Small package that can helps in debugging with API logs for Laravel Project.

Rest APIs Logger This is a small package that can helps in debugging with API logs. Installation Install the package via composer composer require tfs

Sunny Mahajan 7 Aug 31, 2022