innmind/logger
Composer 安装命令:
composer require innmind/logger
包简介
Logger
README 文档
README
Simple abstraction of monolog to simplify (hopefully) the creation of a logger.
Installation
composer require innmind/logger
Usage
use function Innmind\Logger\bootstrap; use Innmind\Url\Url; $logger = bootstrap( 'myApp', Url::of('file://'.__DIR__.'/var/log.txt'), Url::of('sentry://user@sentry.io/project-id'), ); $concrete = $logger(); $fingersCrossed = $logger('error');
In this example both $concrete and $fingersCrossed are instances of Psr\Log\LoggerInterface with the first one that will write each log to the specified file and to sentry, the latter will only write logs when the error level is reached.
If you want to specify the log level for each handler you can do it by adding the level query parameter in the handler url.
统计信息
- 总下载量: 457
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-09-22