Documentation ¶
Index ¶
- type Config
- type InfluxDBHook
- func NewInfluxDB(config *Config, clients ...influxdb.Client) (hook *InfluxDBHook, err error)
- func NewInfluxDBHook(host, database string, tags []string, batching ...bool) (hook *InfluxDBHook, err error)
- func NewWithClientInfluxDBHook(host, database string, tags []string, client influxdb.Client, batching ...bool) (hook *InfluxDBHook, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // InfluxDB Configurations Host string `json:"influxdb_host"` Port int `json:"influxdb_port"` Timeout time.Duration `json:"influxdb_timeout"` Database string `json:"influxdb_database"` Username string `json:"influxdb_username"` Password string `json:"influxdb_password"` UseHTTPS bool `json:"influxdb_https"` Precision string `json:"influxdb_precision"` // Enable syslog format for chronograf logviewer usage Syslog bool `json:"syslog_enabled"` Facility string `json:"syslog_facility"` FacilityCode int `json:"syslog_facility_code"` AppName string `json:"syslog_app_name"` Version string `json:"syslog_app_version"` // Minimum level for push MinLevel string `json:"syslog_min_level"` // Logrus tags Tags []string `json:"logrus_tags"` // Defaults Measurement string `json:"measurement"` // Batching BatchInterval time.Duration `json:"batch_interval"` // Defaults to 5s. BatchCount int `json:"batch_count"` // Defaults to 200. }
Config handles InfluxDB configuration, Logrus tags and batching inserts to InfluxDB
type InfluxDBHook ¶
type InfluxDBHook struct { sync.Mutex // TODO: we should clean up all of these locks // contains filtered or unexported fields }
InfluxDBHook delivers logs to an InfluxDB cluster.
func NewInfluxDB ¶
func NewInfluxDB(config *Config, clients ...influxdb.Client) (hook *InfluxDBHook, err error)
NewInfluxDB returns a new InfluxDBHook.
func NewInfluxDBHook ¶
func NewInfluxDBHook(host, database string, tags []string, batching ...bool) (hook *InfluxDBHook, err error)
NewInfluxDBHook /* DO NOT USE */ creates a hook to be added to an instance of logger and initializes the InfluxDB client
func NewWithClientInfluxDBHook ¶
func NewWithClientInfluxDBHook(host, database string, tags []string, client influxdb.Client, batching ...bool) (hook *InfluxDBHook, err error)
NewWithClientInfluxDBHook /* DO NOT USE */ creates a hook and uses the provided influxdb client
func (*InfluxDBHook) Fire ¶
func (hook *InfluxDBHook) Fire(entry *logrus.Entry) (err error)
Fire adds a new InfluxDB point based off of Logrus entry
func (*InfluxDBHook) Levels ¶
func (hook *InfluxDBHook) Levels() []logrus.Level
Levels are the available logging levels.
Click to show internal directories.
Click to hide internal directories.