助力软件开发企业降本增效 PHP / java源码系统,只需一次付费,代码终身使用! 广告
[TOC] ## 要求 1. php>5.6 ## 教程 1. 修改配置文件 td-agent.conf ``` <source> @type forward port 24224 </source> <match fluentd.test.**> @type stdout </match> ``` 2. 修改 composer.json ``` { "require": { "fluent/logger": "1.0.*" } } ``` 3. 测试代码 ``` <?php require_once __DIR__.'/vendor/autoload.php'; use Fluent\Logger\FluentLogger; $logger = new FluentLogger("localhost","24224"); $logger->post("fluentd.test.follow", array("from"=>"userA", "to"=>"userB")); ```