kingsoft / monolog-handler
Additional handlers monolog, log rotation and cron handler
1.0.1
2024-02-07 20:21 UTC
Requires
- cesargb/php-log-rotation: ^2.7
- dragonmantank/cron-expression: ^3.3
- monolog/monolog: ^3.0
README
Use Kingoft/Utils
to include make a global SETTINGS
available
require $_SERVER['DOCUMENT_ROOT'] . '/vendor/kingsoft/utils/settings.inc.php';
CronRotatingFileHandler
Example usage
$log = new Monolog\Logger( SETTINGS['log']['name'] ); $log->pushHandler( new \Kingsoft\MonologHandler\CronRotatingFileHandler( SETTINGS['log']['location'] . '/' . SETTINGS['log']['name'] . '_info.log', Monolog\Level::fromName( SETTINGS['log']['level'], SETTINGS['logrotate'] ) ) );
With this in the ini-file
[log] name = "app" location = "D:/Projekte/logs" level = Info [logrotate] cronExpression = '* */1 * * *' maxFiles = 2 minSize = 120 compress = false