2017 © Pedro Peláez
 

library elog2

Logging for Yii Framework 2

image

sergebezborodov/elog2

Logging for Yii Framework 2

  • Tuesday, March 10, 2015
  • by sergebezborodov
  • Repository
  • 1 Watchers
  • 0 Stars
  • 358 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 1 % Grown

The README.md

Logger for Yii 2

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, (*1)

Install

Fast install:, (*2)

'components' => array(
    'elog' => array(
        'class' => 'sergebezborodov\elogger\Elogger',
    )
)

All config params:, (*3)

'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' => '*',
            ),
        ),
    ),
),

The Versions

10/03 2015

dev-master

9999999-dev https://github.com/sergebezborodov/elog2

Logging for Yii Framework 2

  Sources   Download

MIT

The Requires

 

log logging yii2