k1low / yalog
Yalog: Yet Another Logger for CakePHP
Fund package maintenance!
k1LoW
Installs: 6 399
Dependents: 1
Suggesters: 0
Security: 0
Stars: 19
Watchers: 4
Forks: 4
Open Issues: 0
Type:cakephp-plugin
Requires
- aws/aws-sdk-php: *
- composer/installers: *
- fluent/logger: v0.3.6
Requires (Dev)
- phpunit/phpunit: 3.7.*
README
RotateFileLog
Usage
First, put `Yalog' directory on app/Plugin in your CakePHP application.
Second, add the following code in bootstrap.php.
<?php
CakePlugin::load('Yalog');
// or
// CakePlugin::loadAll();
App::uses('CakeLog', 'Log');
CakeLog::config('debug', array(
'engine' => 'Yalog.RotateFileLog',
'types' => array('notice', 'info', 'debug'),
'file' => 'debug',
));
CakeLog::config('error', array(
'engine' => 'Yalog.RotateFileLog',
'types' => array('warning', 'error', 'critical', 'alert', 'emergency'),
'file' => 'error',
));
Configure
Rotate
<?php
Configure::write('Yalog.RotateFileLog.weekly', true);
Configure::write('Yalog.RotateFileLog.rotate', 4);
Log4php (Sample)
Usage
First, put `Yalog' directory on app/Plugin in your CakePHP application.
Second, put log4php source directory on app/Plugin/Yalog/Vendor/log4php in your CakePHP application.
http://logging.apache.org/log4php/download.html
Third, add the following code in bootstrap.php.
<?php
CakeLog::config('debug', array(
'engine' => 'Yalog.Log4php',
'types' => array('notice', 'info', 'debug'),
'file' => 'debug',
));
CakeLog::config('error', array(
'engine' => 'Yalog.Log4php',
'types' => array('warning', 'error', 'critical', 'alert', 'emergency'),
'file' => 'error',
));
Configure
Modify following,
- app/Plugin/Yalog/Lib/Log/Engine/log4php.properties
- Log4php::write() in app/Plugin/Yalog/Lib/Log/Engine/log4php.php
License
MIT License