Skip to content

Standard fields

Michael Kenney edited this page May 5, 2020 · 3 revisions

In addition to data logged using WithField or WithFields, some fields are automatically added to all logging events:

  1. caller - The filename and line number where the event occurred.
  2. error - The error value passed via WithError(error), if any.
  3. host - The value of the HOSTNAME environment variable, if any.
  4. level - The logging level of the event. E.g. info.
  5. msg - The log message passed to Info, Warn, Error, Fatal, or Panic.
  6. time - The timestamp when the entry was created.
  7. trace - When enabled, trace contains the full backtrace of the event.

Each of these fields can be disabled or renamed if necessary.

Clone this wiki locally