iamgold/

yii2fluentd

此包的最新版本(1.0.0)没有提供许可证信息。

这是一个轻量级的fluentd客户端库。

1.0.0 2018-03-28 17:43 UTC

This package is auto-updated.

Last update: 2024-09-13 04:19:33 UTC


README

这是一个轻量级的fluentd客户端库。它可以成为Yii2的一个组件。

配置设置

将以下代码注入到web.php或console.php的配置文件中

    'fluentd' => [
        'class' => 'iamgold\yii2fluentd\Fluentd',
        'endpoint' => [endpoint of fluentd http server]
    ]

用法

    Yii::$app->fluentd->send($tag, $params);

方法

    /**
     * send message
     *
     * @param string $tag
     * @param array $params
     * @return ResponseInterface
     */
    public function send(string $tag, array $params)

ResponseInterface 方法

    /**
     * is success
     *
     * @return bool
     */
    public function isSuccess();

    /**
     * get status code
     *
     * @return int
     */
    public function getStatusCode();

    /**
     * get error message
     *
     * @return string
     */
    public function getErrorMessage();