fluent

package module
v0.0.0-...-49110ba Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2021 License: MIT Imports: 9 Imported by: 0

README

fluent

Fluentd is a logging collector.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger is fluent logger sdk.

func NewLogger

func NewLogger(addr string, opts ...Option) (*Logger, error)

NewLogger new a std logger with options. target:

tcp://127.0.0.1:24224
unix:///var/run/fluent/fluent.sock

func (*Logger) Close

func (l *Logger) Close() error

Close close the logger.

func (*Logger) Log

func (l *Logger) Log(level log.Level, keyvals ...interface{}) error

Print print the kv pairs log.

func (*Logger) Print

func (l *Logger) Print(kvpair ...interface{})

Print print the kv pairs log.

type Option

type Option func(*options)

Option is fluentd logger option.

func Async

func Async(async bool) Option

Async with config Async.

func BufferLimit

func BufferLimit(bufferLimit int) Option

BufferLimit with config BufferLimit.

func ForceStopAsyncSend

func ForceStopAsyncSend(forceStopAsyncSend bool) Option

ForceStopAsyncSend with config ForceStopAsyncSend.

func MarshalAsJson

func MarshalAsJson(enable bool) Option

func MaxRetry

func MaxRetry(maxRetry int) Option

MaxRetry with config MaxRetry.

func MaxRetryWait

func MaxRetryWait(maxRetryWait int) Option

MaxRetryWait with config MaxRetryWait.

func RetryWait

func RetryWait(retryWait int) Option

RetryWait with config RetryWait.

func TagPrefix

func TagPrefix(tagPrefix string) Option

TagPrefix with config TagPrefix.

func Timeout

func Timeout(timeout time.Duration) Option

Timeout with config Timeout.

func WriteTimeout

func WriteTimeout(writeTimeout time.Duration) Option

WriteTimeout with config WriteTimeout.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL