mix / monolog
Monolog support Swoole coroutine and cli console printing
Installs: 1 233
Dependents: 3
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: >=7.2.0
- mix/console: ~2.2.0
- monolog/monolog: ^2.0
This package is auto-updated.
Last update: 2024-11-29 06:16:16 UTC
README
支持 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/