Skip to content

Latest commit

 

History

History
279 lines (209 loc) · 6.36 KB

2.Configuration.md

File metadata and controls

279 lines (209 loc) · 6.36 KB

2. Configuration

Table of contents

  1. Installation and Setup
  2. Configuration
  3. Usage

Storage path

<?php

return [
    /* ------------------------------------------------------------------------------------------------
     |  Log files storage path
     | ------------------------------------------------------------------------------------------------
     */
    'storage-path'  => storage_path('logs'),

    // ...
];

Log files pattern

<?php

use Arcanedev\LogViewer\Contracts\Utilities\Filesystem;

return [
    // ...

    /* ------------------------------------------------------------------------------------------------
     |  Log files pattern
     | ------------------------------------------------------------------------------------------------
     */
    'pattern'       => [
        'prefix'    => Filesystem::PATTERN_PREFIX,    // 'laravel-'
        'date'      => Filesystem::PATTERN_DATE,      // '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]'
        'extension' => Filesystem::PATTERN_EXTENSION, // '.log'
    ],

    // ...
];

Localization

<?php

return [
    // ...

    /* ------------------------------------------------------------------------------------------------
     |  Locale
     | ------------------------------------------------------------------------------------------------
     |  Supported locales :
     |    'auto', 'ar', 'bg', 'de', 'en', 'es', 'et', 'fa', 'fr', 'hu', 'hy', 'id', 'it', 'ja', 'ko', 'nl',
     |    'pl', 'pt-BR', 'ro', 'ru', 'sv', 'th', 'tr', 'zh-TW', 'zh'
     */
    'locale'        => 'auto',

    // ...
];

Theme

<?php

return [
    // ...
    
    /* -----------------------------------------------------------------
     |  Theme
     | -----------------------------------------------------------------
     |  Supported themes :
     |    'bootstrap-3', 'bootstrap-4'
     |  Make your own theme by adding a folder to the views directory and specifying it here.
     */
    
    'theme'         => 'bootstrap-4',
    
    // ...
];

Route

<?php

return [
    // ...
    
    /* -----------------------------------------------------------------
     |  Route settings
     | -----------------------------------------------------------------
     */

    'route'         => [
        'enabled'    => true,

        'attributes' => [
            'prefix'     => 'log-viewer',

            'middleware' => env('ARCANEDEV_LOGVIEWER_MIDDLEWARE') ? explode(',', env('ARCANEDEV_LOGVIEWER_MIDDLEWARE')) : null,
        ],
        
        'show' => 'log-viewer::logs.show',
    ],
    
    // ...
];

By default no middleware is added to log-viewer route. If you need middlewares you just have to add a ARCANEDEV_LOGVIEWER_MIDDLEWARE key to your .env file and add middlewares as comma separated values (no space).

  • Example 1: single middleware
ARCANEDEV_LOGVIEWER_MIDDLEWARE=web
  • Example 2: multiple middlewares
ARCANEDEV_LOGVIEWER_MIDDLEWARE=web,auth,custom-middleware

Pagination

<?php

return [
    // ...
    
    /* -----------------------------------------------------------------
     |  Log entries per page
     | -----------------------------------------------------------------
     |  This defines how many logs & entries are displayed per page.
     */

    'per-page'      => 30,
    
    // ...
];

Download

<?php

return [
    // ...

    /* -------------------------------------------------------------------------
     |  Download settings
     | -------------------------------------------------------------------------
     */
    'download'      => [
        'prefix'    => 'laravel-',

        'extension' => 'log',
    ],

    // ...
];

Menu

<?php

return [
    // ...

    /* -------------------------------------------------------------------------
     |  Menu settings
     | -------------------------------------------------------------------------
     */
    'menu'  => [
        'filter-route'  => 'log-viewer::logs.filter',

        'icons-enabled' => true,
    ],

    // ...
];

Icons

<?php

return [
    // ...

    /* -------------------------------------------------------------------------
     |  Icons
     | -------------------------------------------------------------------------
     */
    
    'icons' =>  [
        /**
         * Font awesome >= 4.3
         * http://fontawesome.io/icons/
         */
        'all'       => 'fa fa-fw fa-list',                 // http://fontawesome.io/icon/list/
        'emergency' => 'fa fa-fw fa-bug',                  // http://fontawesome.io/icon/bug/
        'alert'     => 'fa fa-fw fa-bullhorn',             // http://fontawesome.io/icon/bullhorn/
        'critical'  => 'fa fa-fw fa-heartbeat',            // http://fontawesome.io/icon/heartbeat/
        'error'     => 'fa fa-fw fa-times-circle',         // http://fontawesome.io/icon/times-circle/
        'warning'   => 'fa fa-fw fa-exclamation-triangle', // http://fontawesome.io/icon/exclamation-triangle/
        'notice'    => 'fa fa-fw fa-exclamation-circle',   // http://fontawesome.io/icon/exclamation-circle/
        'info'      => 'fa fa-fw fa-info-circle',          // http://fontawesome.io/icon/info-circle/
        'debug'     => 'fa fa-fw fa-life-ring',            // http://fontawesome.io/icon/life-ring/
    ],

    // ...
];

Colors

<?php

return [
    // ...

    /* -------------------------------------------------------------------------
     |  Colors
     | -------------------------------------------------------------------------
     */
    
    'colors' =>  [
        'levels'    => [
            'empty'     => '#D1D1D1',
            'all'       => '#8A8A8A',
            'emergency' => '#B71C1C',
            'alert'     => '#D32F2F',
            'critical'  => '#F44336',
            'error'     => '#FF5722',
            'warning'   => '#FF9100',
            'notice'    => '#4CAF50',
            'info'      => '#1976D2',
            'debug'     => '#90CAF9',
        ],
    ],
];

Stack trace

<?php

return [
    // ...

    /* -----------------------------------------------------------------
     |  Strings to highlight in stack trace
     | -----------------------------------------------------------------
     */

    'highlight' => [
        '^#\d+',
        '^Stack trace:',
    ],
];