Documentation ¶
Index ¶
- type InvalidOptionMessage
- type Line
- type Logger
- func (l *Logger) Close()
- func (l *Logger) Critical(message string)
- func (l *Logger) Debug(message string)
- func (l *Logger) Error(message string)
- func (l *Logger) Fatal(message string)
- func (l *Logger) Info(message string)
- func (l *Logger) Log(message string)
- func (l *Logger) LogWithLevel(message string, level string) error
- func (l *Logger) LogWithOptions(message string, options Options) error
- func (l *Logger) Warn(message string)
- type Message
- type Options
- type Payload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InvalidOptionMessage ¶
InvalidOptionMessage represents an issue with the supplied configuration.
type Line ¶
type Line struct { Body string `json:"line"` Timestamp int64 `json:"timestamp"` App string `json:"app,omitempty"` Level string `json:"level,omitempty"` Env string `json:"env,omitempty"` Meta metaEnvelope `json:"meta,omitempty"` }
Line contains properties related to an individual log message.
type Logger ¶
type Logger struct { Options Options // contains filtered or unexported fields }
Logger is the means by which a user can begin to send logs.
func NewLogger ¶
NewLogger creates a logger with parametrized options and key. This logger can then be used to send logs into LogDNA.
func (*Logger) Close ¶
func (l *Logger) Close()
Close must be called when finished logging to ensure all buffered logs are sent
func (*Logger) LogWithLevel ¶
LogWithLevel sends a log message to LogDNA with a parameterized level.
func (*Logger) LogWithOptions ¶
LogWithOptions allows the user to update options uniquely for a given log message before sending the log to LogDNA.
type Options ¶
type Options struct { App string Env string FlushInterval time.Duration SendTimeout time.Duration Hostname string IndexMeta bool IngestURL string IPAddress string Level string MacAddress string MaxBufferLen int Meta string Tags string Timestamp time.Time }
Options encapsulates user-provided options such as the Level and App that are passed along with each log.
type Payload ¶
type Payload struct { APIKey string `json:"apikey,omitempty"` Hostname string `json:"hostname,omitempty"` IPAddress string `json:"ip,omitempty"` MacAddress string `json:"mac,omitempty"` Tags string `json:"tags,omitempty"` Lines []Line `json:"lines,omitempty"` }
Payload contains the properties sent to the ingestion endpoint.