承接 oz-sysb/fluent-logger 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

oz-sysb/fluent-logger

最新稳定版本:v1.0.4

Composer 安装命令:

composer require oz-sysb/fluent-logger

包简介

fluent-log ライブラリ

README 文档

README

Build Status Coverage Status Total Downloads Packagist License

Requirements

  • PHP 5.3 or higher

Installation

Library is available on Packagist.

It's recommended that you use Composer to install oz-sysb/fluent-logger.

$ composer require oz-sysb/fluent-logger

Usage

PHP side

<?php

require_once __DIR__.'/vendor/autoload.php';

use \Fluent\Logger\FluentLogger as Client;
use \OzSysb\Logger\OzLogger;

// Always define first
OzLogger::setApplication('woodstock');
// init class.
$logger = new OzLogger(new Client('unix:///var/run/td-agent/td-agent.sock'));

// ... snip ...

// Describe every required part

$type = 'api-client';
$logger->info($type, 'Post to https://example.com/api/member, and post params id=100&key=value', __FUNCTION__, __CLASS__);
$logger->info($type, 'Response from https://example.com/api/member response body is {"status": "successed!"}', __FUNCTION__, __CLASS__);


// ... snip ...
$type = 'db';
$logger->info($type, "DB Insert : inserts member_id=100 to super1 table", __FUNCTION__, __CLASS__);
$type = 'db';
$logger->error($type, "DB Error : ERROR 1099 (HY000): Table 'super1' was locked with a READ lock and can't be updted", __FUNCTION__, __CLASS__);

Fluentd side

Use in_forward.

<source>
  @type forward
</source>

License

MIT

统计信息

  • 总下载量: 58.75k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 25
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-05-27