d3yii2 / d3logger
D3 logger
dev-master
2024-10-09 07:27 UTC
Requires
- php: >=7.4.0
- monolog/monolog: 2.x-dev
- psr/log: ^1.1
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2024-10-09 07:28:07 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) ],