Skip to content

Standard formatter properties

Michael Kenney edited this page Aug 13, 2018 · 3 revisions

This is the full list of standard Formatter properties:

// DataKey allows users to put all the log entry parameters into a
// nested dictionary at a given key.
DataKey string

// DisableCaller disables caller data output.
DisableCaller bool

// DisableHostname disables hostname output.
DisableHostname bool

// DisableLevel disables level output.
DisableLevel bool

// DisableMessage disables message output.
DisableMessage bool

// DisableTimestamp disables timestamp output.
DisableTimestamp bool

// DisableTTY disables TTY formatted output.
DisableTTY bool

// Enable full backtrace output.
EnableTrace bool

// EscapeHTML is a flag that notes whether HTML characters should be
// escaped.
EscapeHTML bool

// ForceTTY forces TTY formatted output.
ForceTTY bool

// FieldMap allows users to customize the names of keys for default
// fields.
//
// For example:
// 	formatter := &TextFormatter{FieldMap: FieldMap{
//      LabelCaller: "@caller",
//      LabelData:   "@data",
//      LabelHost:   "@hostname",
//      LabelLevel:  "@loglevel",
//      LabelMsg:    "@message",
//      LabelTime:   "@timestamp",
// 	}}
FieldMap FieldMap

// TimestampFormat allows a custom timestamp format to be used.
TimestampFormat string

Clone this wiki locally