amphp/log
最新稳定版本:v2.0.0
Composer 安装命令:
composer require amphp/log
包简介
Non-blocking logging for PHP based on Amp, Revolt, and Monolog.
README 文档
README
AMPHP is a collection of event-driven libraries for PHP designed with fibers and concurrency in mind.
amphp/log provides a non-blocking stream handler for monolog/monolog.
Installation
This package can be installed as a Composer dependency.
composer require amphp/log
Usage
<?php use Amp\ByteStream; use Amp\Log\ConsoleFormatter; use Amp\Log\StreamHandler; use Monolog\Logger; require dirname(__DIR__) . '/vendor/autoload.php'; // You can also log to a file using amphp/file: // $handler = new StreamHandler(File\openFile(__DIR__ . '/example.log', 'w')); // Here we'll log to the standard output stream of the current process: $handler = new StreamHandler(ByteStream\getStdout()); $handler->setFormatter(new ConsoleFormatter); $logger = new Logger('main'); $logger->pushHandler($handler); $logger->debug("Hello, world!"); $logger->info("Hello, world!"); $logger->notice("Hello, world!"); $logger->error("Hello, world!"); $logger->alert("Hello, world!");
统计信息
- 总下载量: 2.49M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 40
- 点击次数: 1
- 依赖项目数: 92
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2018-03-19