Documentation ¶
Index ¶
- func RegisterParser(name string, parser Parser)
- type AWSHandler
- type BaseHandler
- type CFields
- type CHandler
- type CLevels
- type DiscordHandler
- type ElasticHandler
- type FluentdHandler
- type GCloudHandler
- type GCloudHook
- type GraylogHandler
- type Handler
- type HandlerAsync
- type HandlerSync
- type InfluxDBHandler
- type JSONHandler
- type Levels
- type LogFmtHandler
- type Logger
- type LogglyHandler
- type LogstashHandler
- type MongoDBHandler
- type Parser
- type Parsers
- type RawConfig
- type RedisHandler
- type RollingHandler
- type SentryHandler
- type SlackHandler
- type SysLogHandler
- type TextHandler
- type ZalgoHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterParser ¶
Types ¶
type AWSHandler ¶
type AWSHandler struct { BaseHandler Region string Group string Stream string MaxRetries int `toml:"max_retries"` SSL bool }
func NewAWSHandler ¶
func NewAWSHandler() AWSHandler
func (AWSHandler) Parse ¶
func (config AWSHandler) Parse() (Handler, error)
type BaseHandler ¶
type BaseHandler struct { LevelFrom string `toml:"level_from"` LevelTo string `toml:"level_to"` File string Mode os.FileMode Workers int }
func NewBaseHandler ¶
func NewBaseHandler() BaseHandler
func (BaseHandler) Parse ¶
func (config BaseHandler) Parse() (Handler, error)
type DiscordHandler ¶
type DiscordHandler struct { BaseHandler URL string Username string Author string Inline bool Timestamp string }
func NewDiscordHandler ¶
func NewDiscordHandler() DiscordHandler
func (DiscordHandler) Parse ¶
func (config DiscordHandler) Parse() (Handler, error)
type ElasticHandler ¶
type ElasticHandler struct { BaseHandler URLs []string Host string Index string }
func NewElasticHandler ¶
func NewElasticHandler() ElasticHandler
func (ElasticHandler) Parse ¶
func (config ElasticHandler) Parse() (Handler, error)
type FluentdHandler ¶
type FluentdHandler struct { BaseHandler Host string Port int MaxRetry int `toml:"max_retry"` }
func NewFluentdHandler ¶
func NewFluentdHandler() FluentdHandler
func (FluentdHandler) Parse ¶
func (config FluentdHandler) Parse() (Handler, error)
type GCloudHandler ¶
type GCloudHandler struct { BaseHandler Credentials string Endpoint string Labels map[string]string LogName string `toml:"log_name"` ProjectId string `toml:"project_id"` }
func NewGCloudHandler ¶
func NewGCloudHandler() GCloudHandler
func (GCloudHandler) Parse ¶
func (config GCloudHandler) Parse() (Handler, error)
type GCloudHook ¶
type GCloudHook struct {
// contains filtered or unexported fields
}
func (*GCloudHook) Levels ¶
func (*GCloudHook) Levels() []logrus.Level
type GraylogHandler ¶
type GraylogHandler struct { BaseHandler Address string }
func NewGraylogHandler ¶
func NewGraylogHandler() GraylogHandler
func (GraylogHandler) Parse ¶
func (config GraylogHandler) Parse() (Handler, error)
type Handler ¶
type HandlerAsync ¶
type HandlerAsync struct {
// contains filtered or unexported fields
}
func (*HandlerAsync) SetFormatter ¶
func (handler *HandlerAsync) SetFormatter(f logrus.Formatter)
func (*HandlerAsync) SetHook ¶
func (handler *HandlerAsync) SetHook(hook logrus.Hook)
func (*HandlerAsync) SetStream ¶
func (handler *HandlerAsync) SetStream(stream io.Writer)
func (*HandlerAsync) Wait ¶
func (h *HandlerAsync) Wait()
type HandlerSync ¶
type HandlerSync struct {
// contains filtered or unexported fields
}
func (*HandlerSync) SetFormatter ¶
func (handler *HandlerSync) SetFormatter(f logrus.Formatter)
func (*HandlerSync) SetHook ¶
func (handler *HandlerSync) SetHook(hook logrus.Hook)
func (*HandlerSync) SetStream ¶
func (handler *HandlerSync) SetStream(stream io.Writer)
func (HandlerSync) Wait ¶
func (handler HandlerSync) Wait()
type InfluxDBHandler ¶
type InfluxDBHandler struct { BaseHandler Host string Port int Username string Password string Database string Precision string UseHTTPS bool `toml:"use_https"` BatchCount int `toml:"batch_count"` }
func NewInfluxDBHandler ¶
func NewInfluxDBHandler() InfluxDBHandler
func (InfluxDBHandler) Parse ¶
func (config InfluxDBHandler) Parse() (Handler, error)
type JSONHandler ¶
type JSONHandler struct { BaseHandler DataKey string `toml:"data_key"` Timestamp string }
func NewJSONHandler ¶
func NewJSONHandler() JSONHandler
func (JSONHandler) Parse ¶
func (config JSONHandler) Parse() (Handler, error)
type LogFmtHandler ¶
type LogFmtHandler struct { BaseHandler Timestamp string Sort bool }
func NewLogFmtHandler ¶
func NewLogFmtHandler() LogFmtHandler
func (LogFmtHandler) Parse ¶
func (config LogFmtHandler) Parse() (Handler, error)
type Logger ¶
type Logger struct { Levels Levels Handlers []Handler Fields CFields Defaults logrus.Fields // contains filtered or unexported fields }
func MakeLogger ¶
MakeLogger parses the given configuration file and returns Logger instance.
func ReadLogger ¶
ReadLogger reads configuration file by the given path and returns Logger instance.
type LogglyHandler ¶
type LogglyHandler struct { BaseHandler Token string Host string Tags []string }
func NewLogglyHandler ¶
func NewLogglyHandler() LogglyHandler
func (LogglyHandler) Parse ¶
func (config LogglyHandler) Parse() (Handler, error)
type LogstashHandler ¶
type LogstashHandler struct { BaseHandler Network string Address string Version string Type string }
func NewLogstashHandler ¶
func NewLogstashHandler() LogstashHandler
func (LogstashHandler) Parse ¶
func (config LogstashHandler) Parse() (Handler, error)
type MongoDBHandler ¶
type MongoDBHandler struct { BaseHandler URL string DB string Collection string }
func NewMongoDBHandler ¶
func NewMongoDBHandler() MongoDBHandler
func (MongoDBHandler) Parse ¶
func (config MongoDBHandler) Parse() (Handler, error)
type RawConfig ¶
type RawConfig struct { Levels CLevels Fields CFields Defaults logrus.Fields HandlersRaw []toml.Primitive `toml:"handler"` }
RawConfig represents the struct to parse TOML config into.
type RedisHandler ¶
type RedisHandler struct { BaseHandler Host string Port int Password string Key string Format string App string SourceHost string `toml:"source_host"` Database int TTL string }
func NewRedisHandler ¶
func NewRedisHandler() RedisHandler
func (RedisHandler) Parse ¶
func (config RedisHandler) Parse() (Handler, error)
type RollingHandler ¶
type RollingHandler struct { BaseHandler SubHandler toml.Primitive `toml:"handler"` File string `toml:"file"` MaxSize int `toml:"max_size"` MaxAge int `toml:"max_age"` MaxBackups int `toml:"max_backups"` LocalTime bool `toml:"local_time"` Compress bool `toml:"compress"` }
func NewRollingHandler ¶
func NewRollingHandler() RollingHandler
func (RollingHandler) Parse ¶
func (config RollingHandler) Parse() (Handler, error)
type SentryHandler ¶
type SentryHandler struct { BaseHandler DSN string Timeout string }
func NewSentryHandler ¶
func NewSentryHandler() SentryHandler
func (SentryHandler) Parse ¶
func (config SentryHandler) Parse() (Handler, error)
type SlackHandler ¶
type SlackHandler struct { BaseHandler HookURL string `toml:"hook_url"` IconURL string `toml:"icon_url"` Channel string IconEmoji string `toml:"icon_emoji"` Username string }
func NewSlackHandler ¶
func NewSlackHandler() SlackHandler
func (SlackHandler) Parse ¶
func (config SlackHandler) Parse() (Handler, error)
type SysLogHandler ¶
type SysLogHandler struct { BaseHandler Network string Address string Tag string Priority string }
func NewSysLogHandler ¶
func NewSysLogHandler() SysLogHandler
func (SysLogHandler) Parse ¶
func (config SysLogHandler) Parse() (Handler, error)
type TextHandler ¶
type TextHandler struct { BaseHandler Timestamp string Sort bool TruncateLevel bool `toml:"truncate_level"` }
func NewTextHandler ¶
func NewTextHandler() TextHandler
func (TextHandler) Parse ¶
func (config TextHandler) Parse() (Handler, error)
type ZalgoHandler ¶
type ZalgoHandler struct {
BaseHandler
}
func NewZalgoHandler ¶
func NewZalgoHandler() ZalgoHandler
func (ZalgoHandler) Parse ¶
func (config ZalgoHandler) Parse() (Handler, error)
Source Files ¶
- config.go
- handler.go
- handler_aws.go
- handler_base.go
- handler_discord.go
- handler_elastic.go
- handler_fluentd.go
- handler_gcloud.go
- handler_graylog.go
- handler_influxdb.go
- handler_json.go
- handler_logfmt.go
- handler_loggly.go
- handler_logstash.go
- handler_mongodb.go
- handler_redis.go
- handler_rolling.go
- handler_sentry.go
- handler_slack.go
- handler_syslog.go
- handler_text.go
- handler_zalgo.go
- logger.go
- parsers.go
- tformat.go
Click to show internal directories.
Click to hide internal directories.