superbalist/monolog-google-cloud-json-formatter
最新稳定版本:1.0.0
Composer 安装命令:
composer require superbalist/monolog-google-cloud-json-formatter
包简介
A Monolog extension for formatting log entries for Google Cloud Logging
README 文档
README
This library works in conjunction with https://github.com/GoogleCloudPlatform/fluent-plugin-google-cloud
fluent-plugin-google-cloud is an output plugin for fluentd which sends logs to the Google Cloud Logging API.
This formatter outputs logs entries in json which the fluent-plugin-google-cloud application understands.
Installation
composer require superbalist/monolog-google-cloud-json-formatter
Usage
use Monolog\Logger; use Monolog\Handler\StreamHandler; use Superbalist\Monolog\Formatter; // create a handler $handler = new StreamHandler('path/to/your.log', Logger::WARNING); // use custom formatter in handler $handler->setFormatter(new GoogleCloudJsonFormatter()); // create a log channel $log = new Logger('name'); $log->pushHandler($handler); // add records to the log $log->addWarning('Foo'); $log->addError('Bar');
统计信息
- 总下载量: 348.61k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 16
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-04-04