Skip to content

Monolog support Swoole coroutine and cli console printing

Notifications You must be signed in to change notification settings

mix-php/monolog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

Mix Monolog

支持 Swoole 协程的 Monolog,支持 cli 控制台打印

Usage

安装:

composer require mix/monolog

创建 Logger:

$logger  = new \Mix\Monolog\Logger('API', [new \Mix\Monolog\Handler\ConsoleHandler], [new \Monolog\Processor\PsrLogMessageProcessor]);
$handler = new \Mix\Monolog\Handler\RotatingFileHandler(sprintf('%s/runtime/logs/api.log', $basePath), 7);
$logger->pushHandler($handler);

调用:

$logger->info('server started');

License

Apache License Version 2.0, http://www.apache.org/licenses/

About

Monolog support Swoole coroutine and cli console printing

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages