Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultOptions = &HandlerOptions{ TimeFields: []string{"time", "ts", "@timestamp", "timestamp"}, MessageFields: []string{"message", "msg"}, LevelFields: []string{"level", "lvl", "loglevel", "severity"}, }
Functions ¶
Types ¶
type Handler ¶
type Handler interface { CanHandle(line []byte) bool Prettify(skipUnchanged bool) []byte logfmt.Handler }
Handler can recognize it's log lines, parse them and prettify them.
type HandlerOptions ¶
func HandlerOptionsFrom ¶
func HandlerOptionsFrom(cfg config.Config) *HandlerOptions
type JSONHandler ¶
type JSONHandler struct { Opts *HandlerOptions Level string Time time.Time Message string Fields map[string]string }
JSONHandler can handle logs emitted by logrus.TextFormatter loggers.
func (*JSONHandler) TryHandle ¶
func (h *JSONHandler) TryHandle(d []byte, out *model.Structured) bool
TryHandle tells if this line was handled by this handler.
func (*JSONHandler) UnmarshalJSON ¶
func (h *JSONHandler) UnmarshalJSON(data []byte) bool
UnmarshalJSON sets the fields of the handler.
type LogfmtHandler ¶
type LogfmtHandler struct { Opts *HandlerOptions Level string Time time.Time Message string Fields map[string]string }
LogfmtHandler can handle logs emmited by logrus.TextFormatter loggers.
func (*LogfmtHandler) TryHandle ¶
func (h *LogfmtHandler) TryHandle(d []byte, out *model.Structured) bool
CanHandle tells if this line can be handled by this handler.
func (*LogfmtHandler) UnmarshalLogfmt ¶
func (h *LogfmtHandler) UnmarshalLogfmt(data []byte) bool
HandleLogfmt sets the fields of the handler.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.