Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) Debug(line string, opt ...map[string]interface{}) error
- func (c *Client) Emit(line string, opt ...map[string]interface{}) error
- func (c *Client) EmitWithLevel(level, line string, opt ...map[string]interface{}) error
- func (c *Client) Err(line string, opt ...map[string]interface{}) error
- func (c *Client) Fatal(line string, opt ...map[string]interface{}) error
- func (c *Client) Info(line string, opt ...map[string]interface{}) error
- func (c *Client) RunDaemon(size int, interval time.Duration)
- func (c *Client) Trace(line string, opt ...map[string]interface{}) error
- func (c *Client) Warn(line string, opt ...map[string]interface{}) error
- type Config
- type Daemon
- type LogData
Constants ¶
View Source
const ( LogLevelDebug = "Debug" LogLevelTrace = "Trace" LogLevelInfo = "Info" LogLevelWarn = "Warn" LogLevelError = "Error" LogLevelFatal = "Fatal" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Config
// contains filtered or unexported fields
}
Client handles logging to LogDNA.
func (*Client) EmitWithLevel ¶
Emit sends a log of a given level.
type Config ¶
type Config struct {
APIKey string
App string
Env string
Hostname string
IP string
MacAddr string
Tags []string
MinimumLevel string
Sync bool
Debug bool
NoRetry bool
Timeout time.Duration
CustomEndpoint string
CheckpointSize int
CheckpointInterval time.Duration
// contains filtered or unexported fields
}
Config contains parameters for LogDNA.
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
Daemon is background daemon for sending logs. This struct stores logs and sends log to LogDNA in each checkpoint timing.
func NewDaemon ¶
NewDaemon creates new Daemon. size is number of logs to send LogDNA API in single checkpoint. interval is the time of checkpoint interval. fn is function called in each checkpoint, to sends logs to LogDNA API.
func (*Daemon) Flush ¶
func (d *Daemon) Flush()
Flush gets logs from the internal spool and execute flushLogs function.
Click to show internal directories.
Click to hide internal directories.