Log4j2 AsyncAppender in Elasticsearch 5.x


(Tjebbe Vlieg) #1

Hi!

I want to configure an AsyncAppender for ElasticSearch its own logging, using Log4j2. I first tried to implement it using the log4j2.properties file in the config directory:

appender.async.type = Async
appender.async.name = async
appender.async.appenderRef.type = AppenderRef
appender.async.appenderRef.ref = <other_appender>
appender.async.shutdownTimeout = 10
rootLogger.level = info
rootLogger.appenderRef.async.ref = async

This configuration didn't raise errors, but unfortunately also didn't result in log messages being forwarded to the referred appender.

It was suggested in other posts that the AsyncAppender could not be configured using a properties file, so I translated the properties file into an xml file (log4j2.xml). However upon restarting, elasticsearch didn't pick up this xml config file:

ERROR: no log4j2.properties found; tried [/etc/elasticsearch/<node_name>] and its subdirectories

My questions are thus:

  • Is it possible at all to configure an AsyncAppender using log4j2.properties?
  • Is it possible to configure log4j2 in Elasticsearch 5.x with log4j2.xml instead of a properties-file?

Thanks!


How can i configure log4j to use AsyncAppender instead SocketAppender?
(system) #2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.