yaro/jarboe-log-viewer

Logs viewer for Jarboe admin panel

1.1.0 2020-10-07 12:10 UTC

This package is auto-updated.

Last update: 2024-12-08 16:52:10 UTC


README

Integrate ArcaneDev/LogViewer in Jarboe project.

JarboeLogViewer

Installation

Install package via Composer:

composer require yaro/jarboe-log-viewer

Publish config file and views:

php artisan vendor:publish --provider="Yaro\JarboeLogViewer\ServiceProvider"

In config/logging.php make sure daily channel is within channels of stack log channel, that is used by default in "pure" Laravel application, e.g.:

// config/logging.php

return [
   //...
  'channels' => [
    'stack' => [
      'driver' => 'stack',
      'name' => 'channel-name',
      'channels' => ['daily', 'slack'],
    ],

    'daily' => [
        'driver' => 'daily',
        'path' => storage_path('logs/laravel.log'),
        'level' => 'debug',
        'days' => 7,
    ],

    'slack' => [
      'driver' => 'slack',
      'url' => env('LOG_SLACK_WEBHOOK_URL'),
      'level' => 'critical',
    ],
    //...
];

Optionally, add url to log viewer page in navigation sidebar:

<!-- resources/views/vendor/jarboe/inc/navigation.blade.php -->

<li>
    <a href="{{ route('log-viewer::dashboard') }}">
        <i class="fa fa-lg fa-fw fa-exclamation-triangle"></i>
        <span class="menu-item-parent">Logs</span>
    </a>
</li>

Usage

Logs can be viewed on log-viewer under your admin panel prefix, by default it will be http://localhost/admin/log-viewer.

Look at config/log-viewer.php for more configuration options.

License

MIT