Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hook ¶
type Hook struct { sync.Mutex Conn net.Conn Context logrus.Fields Formatter logrus.Formatter // contains filtered or unexported fields }
Hook represents a Logrus Logzio hook
func New ¶
New creates a default Logzio hook. What it does is taking `token` and `appName` and attaching them to the log data. In addition, it sets a connection to the Logzio's Logstash endpoint. If the connection fails, it returns an error.
To set more advanced configurations, initialize the hook in the following way:
hook := &Hook{HookOpts{ Conn: myConn, Context: logrus.Fields{...}, Formatter: myFormatter{} }
type SimpleFormatter ¶
type SimpleFormatter struct {
// contains filtered or unexported fields
}
SimpleFormatter represents a simple JSON formatter
Click to show internal directories.
Click to hide internal directories.