Skip to content

Suro log4j appender configuration

Jae Hyeon Bae edited this page Dec 31, 2013 · 6 revisions

com.netflix.suro.input.Log4jAppender can be used as the Suro client. Let's assume we define Suro log4j appender as the following:

log4j.appender.SURO=com.netflix.suro.input.Log4jAppender

The common prefix log4j.appender.SURO is omitted in the table.

Key Description Default value
formatterClass Log4j appender is converting LoggingEvent object to text data only. The formatterClass implements the logic of converting LoggingEvent object to text. JsonLog4jFormatter
datetimeFormat The format of datetime field in log line yyyy-MM-dd'T'HH:mm:ss,SSS
app The value of the application field in the Message header defaultApp

Formatter class should contain the logic to extract routing key from LoggingEvent object and message routing key will be set to the one from the formatter class. By default, JsonLog4jFormatter and StringLog4jFormatter tries to extract routing key from log4j logging event object only when event object is Map instance. From Map log4j logging event, "routingKey" field value will be set as the routing key.

The following properties are same as the Suro client configurations

  • compression
  • loadBalancerType
  • loadBalancerServer
  • clientType
  • asyncQueueType
  • asyncMemoryQueueCapacity
  • asyncFileQueuePath

SerDe is not needed because log4j aways serializes Java objects into text

Clone this wiki locally