Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mix-php/monolog
Monolog support Swoole coroutine and cli console printing
https://github.com/mix-php/monolog
log mix
Last synced: 27 days ago
JSON representation
Monolog support Swoole coroutine and cli console printing
- Host: GitHub
- URL: https://github.com/mix-php/monolog
- Owner: mix-php
- Created: 2018-12-21T08:07:59.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-30T06:45:28.000Z (about 4 years ago)
- Last Synced: 2024-11-13T06:32:49.502Z (29 days ago)
- Topics: log, mix
- Language: PHP
- Homepage:
- Size: 46.9 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-swoole - mix/monolog - A coroutine-friendly logging library. It's based on [Monolog](https://github.com/Seldaek/monolog). :globe_with_meridians: (Logging)
README
## 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/