logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolas Bär <nicolas.b...@gmail.com>
Subject Log4j2 Custom Layout Flume Appender
Date Fri, 07 Mar 2014 13:22:03 GMT

I'm trying to use Log4j2 to send certain log messages to Apache Flume.
Flume should then push the messages to Elasticsearch in order to analyze
the data with Kibana. The setup works fine using the JSONLayout, but this
layout does not provide enough flexibility for my use case. Currently the
message is saved to Elasticsearch as one field. Therefore I'd like to
replace the JSONLayout with a custom implementation to extract certain
fields from the log messages. I followed the instructions on the following
page: http://logging.apache.org/log4j/2.x/manual/extending.html#Layouts
But I'm not able to specify the custom layout in the log4j2.xml file.
What's the correct syntax to do this?

I tried the <layout> tag and specified my custom class in the name
attribute. This will throw the following error message: ERROR Flume
contains an invalid element or attribute "layout".

Any help is highly appreciated, thanks.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message