kephp / log4php-helper
Support a trait class to embed to your any php class to let them can be loggable.
1.0.2
2020-06-18 03:33 UTC
Requires
- php: >=7.1
- apache/log4php: ^2.3
This package is not auto-updated.
Last update: 2025-03-21 21:49:17 UTC
README
Support a trait class to embed to your any php class to let them can be loggable.
Install
composer require kephp/log4php-helper
How to use
How to configure the Log4php env
use Ke\Log\LoggableTrait;
class YoutAnyClass {
// embed to your class
use LoggableTrait;
}
// for use
YoutAnyClass::getStaticLogger()->trace('message');
YoutAnyClass::getStaticLogger()->debug('message');
YoutAnyClass::getStaticLogger()->info('message');
$obj = new YoutAnyClass();
$obj->getLogger('anyName')->trace('message');
$obj->trace('message');
LoggableTrait::filterStaticLoggerName($name)
and LoggableTrait::filterLoggerName($name)
will try to transform \
(PHP class namespace spr) to .
.