# Possible to use XML for ES log4j2 configuation?

**URL:** <https://discuss.elastic.co/t/possible-to-use-xml-for-es-log4j2-configuation/131916>\
**Category:** Elasticsearch\
**Created:** [May 15, 2018, 10:56am UTC](https://discuss.elastic.co/t/possible-to-use-xml-for-es-log4j2-configuation/131916 "2018-05-15T10:56:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mathissimio](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mathissimio](https://discuss.elastic.co/u/mathissimio)\
**Post date:** [May 15, 2018, 10:56am UTC](https://discuss.elastic.co/t/possible-to-use-xml-for-es-log4j2-configuation/131916/1 "2018-05-15T10:56:12Z")

</div>

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.)

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 15, 2018, 11:56am UTC](https://discuss.elastic.co/t/possible-to-use-xml-for-es-log4j2-configuation/131916/2 "2018-05-15T11:56:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mathissimio](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mathissimio](https://discuss.elastic.co/u/mathissimio)\
**Post date:** [May 16, 2018, 7:03am UTC](https://discuss.elastic.co/t/possible-to-use-xml-for-es-log4j2-configuation/131916/3 "2018-05-16T07:03:25Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 16, 2018, 7:47am UTC](https://discuss.elastic.co/t/possible-to-use-xml-for-es-log4j2-configuation/131916/4 "2018-05-16T07:47:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 13, 2018, 7:47am UTC](https://discuss.elastic.co/t/possible-to-use-xml-for-es-log4j2-configuation/131916/5 "2018-06-13T07:47:49Z")

</div>

Closed on June 13, 2018, 7:47am UTC

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