sergebezborodov / elog2
Logging for Yii Framework 2
Installs: 5 056
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
Requires
- php: >=5.3.0
- yiisoft/yii2: *
- yiisoft/yii2-composer: *
This package is not auto-updated.
Last update: 2025-03-25 08:35:40 UTC
README
Logger component for Yii Framework 2. Key features:
- extended logging to files, each file for different log types
- tunable logging levels
- ouput all logs to console for console application with colors
- easy to extend
Install
Fast install:
'components' => array( 'elog' => array( 'class' => 'sergebezborodov\elogger\Elogger', ) )
All config params:
'components' => array( 'elog' => array( 'class' => 'sergebezborodov\elogger\Elogger', // addition log levels 'levels' => array('warning', 'fail'), // also can be 'levels' => 'warning, fail' 'handlers' => array( // file log array( 'class' => 'sergebezborodov\elogger\handlers\File', // log message formater 'formatter' => array( 'class' => 'sergebezborodov\elogger\formaters\Standart', // date format 'dateFormat' => 'Y-m-d H:i:s', // log message format 'messageFormat' => '{date} [{level}]{level-spaces} {from} {message}', ), // by default file log handler accept all messages from all levels // you can specify levels for this handler by array or coma separated string // also can set uniq levels that main component doesn't has // 'level' => array('trace', 'fullshit'), 'levels' => '*', // default log file 'defaultFile' => 'application', // log file extension (without dot) 'extension' => 'log', // log file directory, by default runtime path 'path' => 'application.runtime', // max log file size, if over file will be rotated 'maxFileSize' => 1024, // max log files count 'maxFiles' => 10, // new directory mode permission 'directoryMode' => 0777, // new log file permission 'fileMode' => 0640, ), // color console handler array( 'class' => 'sergebezborodov\elogger\handlers\Console', // log message formatter 'formatter' => array( 'class' => 'sergebezborodov\elogger\formaters\ConsoleColor', // date format 'dateFormat' => 'Y-m-d H:i:s', // log message format 'messageFormat' => '{date} [{level}]{level-spaces} {from} {message}', ), // by default file log handler accept all messages from all levels // you can specify levels for this handler by array or coma separated string // also can set uniq levels that main component doesn't has // 'level' => array('trace', 'fullshit'), 'levels' => '*', ), ), ), ),