Possible to use XML for ES log4j2 configuation?

Although not a huge fan of XML I prefer it over the Java properties file format. Besides my preference, it's the most common format to configure log4j2.

I tried to simply replace the log4j2.properties with an log4j2.xml. However, this results in ES not starting.

Is there a way to switch to XML to configure the ES app logging?
(Without touching the ES source.)

No it's not possible without adding some librairies in the distribution and probably changing some code (which I'm unsure).

Hi David, thanks for your quick reply!

If I understood right, you're part of the ES dev team. You might be considering switching / allowing XML: Using XML has one big advantage over properties. You can define filters. My usecase: Due to my business logic I run often (up to 10 GB/day) into DocumentMissingExceptions (complete stacktrace in DEBUG level). I'd like to filter those out.

BTW: Thank you for this great product :slight_smile:

I'm not sure but if my memory recalls correctly I think I spoke with @jasontedor a long time ago about this and the problem is that supporting XML configuration needs to bring some new dependencies to read the XML and there was at least 2 concerns about this:

  • Adding new jars to the distribution for a very few needs
  • Adding new jars can lead to security issues as well. I have seen lot of attacks in the past through XML parsers
  • Adding new jars might conflict with the other jars needed by elasticsearch

But @jasontedor can probably confirm that and may has an idea on how to solve your use case without the need of bringing XML to Elasticsearch.

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