d3yii2/d3logger

dev-master 2024-11-07 17:45 UTC

This package is auto-updated.

Last update: 2024-11-07 17:45:14 UTC


README

create Monolog logs in runtime directory

composer require d3yii2/d3logger dev-master

In configuration file define only path

        'myLoggel=r' => [
            'class' => 'd3logger\D3Monolog',
            'name' => 'myLogger',
            'fileName' => 'robotex',
            'directory' => 'devices',
            'maxFiles' => 7,
        ],

Ussage

use d3logger\D3Monolog;

Yii::$app->myLogger->info('ok',['a','b']);

Runtime viewer

configure

To console config migration path add

    '@vendor/d3yii2/d3logger/src/migrations',

web connnfig module

        'd3logger' => [
            'class' => 'd3logger\Module',
            'leftMenu' => 'company',
            'accessRoles' => [
                'D3loggerView' => [
                    'logging/sorting',  //directories
                    'logs',
                ],
            ]
        ],

translation

    'd3logger' => [
        'class' => 'yii\i18n\PhpMessageSource',
        'basePath' => '@vendor/d3yii2/d3logger/src/messages',
        'sourceLanguage' => 'en-US',
    ],

Left menu

    [
        'label' => 'Logfaili',
        'icon' => 'bars',
        'type' => 'submenu',
        'url' => ['/d3logger/log-viewer'],
        'visible' => Yii::$app->user->can(D3loggerViewUserRole::NAME)
    ],