iamgold/yii2fluentd

There is no license information available for the latest version (1.0.0) of this package.

This is a lightweight client library of fluentd

1.0.0 2018-03-28 17:43 UTC

This package is auto-updated.

Last update: 2024-05-13 03:38:07 UTC


README

This is a lightweight client library of fluentd. It be a component in Yii2.

Config setting

Injected the code belows into config file of web.php or console.php

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

Usage

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

Methods

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

ResponseInterface Methods

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

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

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