# log4php-helper **Repository Path**: kephp/log4php-helper ## Basic Information - **Project Name**: log4php-helper - **Description**: log4php helper - **Primary Language**: PHP - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-06-09 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # log4php-helper Support a trait class to embed to your any php class to let them can be loggable. [log4php quickstart](https://logging.apache.org/log4php/quickstart.html) ## Install ```shell composer require kephp/log4php-helper ``` ## How to use [How to configure the Log4php env](https://logging.apache.org/log4php/docs/configuration.html) ```php 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 `.` .