Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultFluentHost = "127.0.0.1" DefaultFluentPort = 24224 DefaultChannelLength = 1000 DefaultBufferLength = 10 * 1024 DefaultMaxTrialForConnection = 10 DefaultConnectionTimeout = 3 * time.Second DefaultBufferingTimeout = 100 * time.Millisecond DefaultTagPrefix = "" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // You can customize fluentd host and port. FluentHost string FluentPort int // If buffered channel's length is equal to ChannelLength, main thread blocks. ChannelLength int // If all posted messages' size reaches BufferLength, logger flushes all logs. BufferLength int // Retry connection with fluentd MaxTrialForConnection times. MaxTrialForConnection int // Wait for connection until ConnectionTimeout. ConnectionTimeout time.Duration // Logger flushes its buffer on each BufferingTimeout interval. BufferingTimeout time.Duration // Tag prefix. When set TagPrefix to "foo" and post with "bar.baz", // you'll get "foo.bar.baz" tag. TagPrefix string }
Config is just for fluent.NewLogger() argument.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger owns asynchronous logging to fluentd.
func NewLogger ¶
NewLogger() launches a goroutine to log and returns logger. Logger has a channel to interact with the goroutine.
Click to show internal directories.
Click to hide internal directories.