Skip to content

Suro JsonLog4jFormatter

g9yuayon edited this page Dec 9, 2013 · 2 revisions

JsonLog4jFormatter assumes LoggingEvent.getMessage() returns a Map payload, and serializes it into a log line. If we want to use JsonLog4jFormatter, you should configure Log4j to put Java Map to LoggingEvent instead of String.

This will populate the following additional fields to JSON string.

  • ts: Timestamp when the log is collected on JsonLog4jFormatter
  • datetime: Formatted date time string
  • logLevel: equals to LoggingEvent.getLogLevel()
  • class: equals to LoggingEvent.getLoggerName()
Clone this wiki locally