Documentation
¶
Index ¶
- type Config
- type LoggingHubEntriesReq
- type LoggingHubEntry
- type LoggingHubHook
- func (hook *LoggingHubHook) AddFilter(name string, fn func(interface{}) interface{})
- func (hook *LoggingHubHook) AddIgnore(name string)
- func (hook *LoggingHubHook) Fire(entry *logrus.Entry) error
- func (hook *LoggingHubHook) Flush()
- func (hook *LoggingHubHook) Levels() []logrus.Level
- func (hook *LoggingHubHook) Run()
- func (hook *LoggingHubHook) SetLevels(levels []logrus.Level)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { LoggingHubURL string Senders []string LogLevels []logrus.Level DefaultIgnoreFields map[string]struct{} DefaultFilters map[string]func(interface{}) interface{} BatchSizeInLines int RequestSizeLimit int FlushInterval time.Duration }
Config configuration for the logging agent hook
type LoggingHubEntriesReq ¶
type LoggingHubEntriesReq struct { Senders []string `json:"senders"` Entries []*LoggingHubEntry `json:"entries"` }
LoggingHubEntriesReq request for the log entries
type LoggingHubEntry ¶
type LoggingHubEntry struct { Log string `json:"log"` Time string `json:"time"` Level string `json:"level"` Fields map[string]string `json:"fields"` }
LoggingHubEntry logging hub log entry
type LoggingHubHook ¶
type LoggingHubHook struct {
// contains filtered or unexported fields
}
LoggingHubHook logrus hook for the logging agent
func NewLoggingHubHook ¶
func NewLoggingHubHook(loggingHubURL string, senders []string) (*LoggingHubHook, error)
NewLoggingHubHook creates a new logging agent hook
func NewWithConfig ¶
func NewWithConfig(conf Config) (*LoggingHubHook, error)
NewWithConfig returns initialized logrus hook by config setting.
func (*LoggingHubHook) AddFilter ¶
func (hook *LoggingHubHook) AddFilter(name string, fn func(interface{}) interface{})
AddFilter adds a custom filter function.
func (*LoggingHubHook) AddIgnore ¶
func (hook *LoggingHubHook) AddIgnore(name string)
AddIgnore adds field name to ignore.
func (*LoggingHubHook) Fire ¶
func (hook *LoggingHubHook) Fire(entry *logrus.Entry) error
Fire is invoked by logrus and sends log to fluentd logger.
func (*LoggingHubHook) Levels ¶
func (hook *LoggingHubHook) Levels() []logrus.Level
Levels returns logging level to fire this hook.
func (*LoggingHubHook) SetLevels ¶
func (hook *LoggingHubHook) SetLevels(levels []logrus.Level)
SetLevels sets logging level to fire this hook.
Click to show internal directories.
Click to hide internal directories.