Documentation ¶
Index ¶
Constants ¶
View Source
const LogChanSize = 5000
LogChanSize default chan size
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // Debugf(format string, args ...interface{}) // Infof(format string, args ...interface{}) // Warnf(format string, args ...interface{}) // Errorf(format string, args ...interface{}) // LogWithLabels write logs without Log level but with labels LogWithLabels(lables map[string]string, level LogLevel, line string) Shutdown() }
Client client interface
func NewClientJSON ¶ added in v0.1.3
func NewClientJSON(conf ClientConfig) (Client, error)
NewClientJSON client with JSON
type ClientConfig ¶
type ClientConfig struct { // E.g. http://localhost:3100/api/prom/push PushURL string // E.g. "{job=\"somejob\"}" // Labels string BatchWait time.Duration BatchEntriesNumber int // Logs are sent to Promtail if the entry level is >= SendLevel SendLevel LogLevel // Logs are printed to stdout if the entry level is >= PrintLevel PrintLevel LogLevel // MaxRetry enabled retry, default disabled, 0 MaxRetry int // RetryMinWait, default 1s RetryMinWait time.Duration // RetryMaxWait default 30s RetryMaxWait time.Duration }
ClientConfig new config: MaxRetry
type ClientJSON ¶ added in v0.1.3
type ClientJSON struct {
// contains filtered or unexported fields
}
ClientJSON client with JSON format
func (*ClientJSON) LogWithLabels ¶ added in v0.1.3
func (c *ClientJSON) LogWithLabels(lables map[string]string, level LogLevel, line string)
func (*ClientJSON) Shutdown ¶ added in v0.1.3
func (c *ClientJSON) Shutdown()
Click to show internal directories.
Click to hide internal directories.