Replacing Log4J2 with Logback

With elasticsearch 1.x, you could simply remove the log4j jars from the lib dir, and drop in the slf4j and logback jars.

The same approach doesn't seem to work with elasticsearch 5.x: Removing the log4j2-core jar results in NoClassDefFoundError: org/apache/logging/log4j/core/config/Configuration.

Is there still a way to use a different logging framework, or is log4j2 the only option now?

You want to replace it for the server (not the transport client)? Sorry, that's not going to work without some magic, and we will definitely not support it.

Adding to this that if you are using the TransportClient you can follow this guide:

https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/_using_another_logger.html

Thanks; I was hoping to replace the logger for the standalone server, embedded server, and the transport client. Looks like only latter is still possible, so I'll have to rethink my logging infrastructure as part of the migration :frowning:

(Have been using Loggly with this library, which doesn't have a log4j2 equivalent; even Logstash doesn't seem to have an appender for log4j2?)

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