Logging
Maverics is capable of integrating with log aggregation systems to consume and process logs.
Log records are sent to Syslog and include a
maverics
identifier. Most log aggregation platforms (ELK, Loggly, etc.) can accept log streams via Syslog.To run Maverics in debug mode, set the
MAVERICS_DEBUG_MODE
environment variable to true
. Logging will be much more verbose when running in debug mode.logger:
level: < debug | info | error >
logSessionID: < true | false >
timeFormat: < ANSIC | RFC822 | RFC822Z | RFC822Z | RFC1123 | ... >
Use
level
to set the verbosity of the Orchestrator logs. For example, level: error
will only show error logs (when debug mode is off). The following log levels are supported:- debug
- info
- error
Enabling debug mode from the command line (
-v
/--verbose
) or through the environment variable (MAVERICS_DEBUG_MODE
) will take precedence over the level
field.Set
logSessionID: true
(false
by default when unset) to append the session ID to log messages where they are relevant. This setting is useful when filtering logs to isolate a problem with a particular session.Use
timeFormat
to change the formatting of the log timestamps.For example, the following configuration will create timestamps in the format
ts=:"Mon Jan 2 15:04:05 2006"
:logger:
timeFormat: ANSIC
The following format names are supported (case insensitive):
Name | Format |
---|---|
ANSIC | "Mon Jan _2 15:04:05 2006" |
UnixDate | "Mon Jan _2 15:04:05 MST 2006" |
RubyDate | "Mon Jan 02 15:04:05 -0700 2006" |
RFC822 | "02 Jan 06 15:04 MST" |
RFC822Z | "02 Jan 06 15:04 -0700" |
RFC850 | "Monday, 02-Jan-06 15:04:05 MST" |
RFC1123 | "Mon, 02 Jan 2006 15:04:05 MST" |
RFC1123Z | "Mon, 02 Jan 2006 15:04:05 -0700" |
RFC3339 | "2006-01-02T15:04:05Z07:00" |
RFC3339Nano | "2006-01-02T15:04:05.999999999Z07:00" |
Kitchen | "3:04PM" |
Stamp | "Jan _2 15:04:05" |
StampMilli | "Jan _2 15:04:05.000" |
StampMicro | "Jan _2 15:04:05.000000" |
StampNano | "Jan _2 15:04:05.000000000" |
Custom time formats can be specified with a layout string using the date in the examples above (Jan 2 15:04:05 2006) as per Golang's time format. For example:
logger:
timeFormat: "2006-01-02 15:04:05 MST"
Orchestrator logs are always in UTC. When setting a custom
timeFormat
string as above, the MST
time zone abbreviation (or -0700
offset) in the layout string does not change this but will set the position of UTC
or -0000
in the timestamp.