Documentation ¶
Index ¶
Constants ¶
View Source
const ( // PrecisionDefault represents the default precision used for the InfluxDB points. PrecisionDefault = "ns" // DatabaseDefault is the default database that we will write to, if not specified otherwise in the Config for the hook. DatabaseDefault = "logrus" // DefaultMeasurementValue is the default measurement that we will assign to each point, unless there is a field called "measurement". DefaultMeasurementValue = "logrus" // BatchIntervalDefault represents the number of seconds that we wait for a batch to fill up. // After that we flush it to InfluxDB whatsoever. BatchIntervalDefault = 5 // BatchSizeDefault represents the maximum size of a batch. BatchSizeDefault = 100 )
View Source
const ( // LevelTag represents the name of the tag that will have the log level assigned. LevelTag = "level" // MessageField represents the name of the fields that we will assign the log message to. MessageField = "message" // MeasurementField represents the name of the field that we will get the measurement from the log fields. MeasurementField = "measurement" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Client influx.Client Precision string Database string DefaultMeasurement string // Tags that we will extract from the log fields and set them as Influx point tags. Tags []string BatchInterval int // seconds BatchSize int }
Config is the struct that we will use to configure our Influxus hook to Logrus.
type Hook ¶
type Hook struct {
// contains filtered or unexported fields
}
Hook represents the Logrus hook to InfluxDB.
Click to show internal directories.
Click to hide internal directories.