# Elasticsearch AsyncAppender configuration

**URL:** https://discuss.elastic.co/t/elasticsearch-asyncappender-configuration/22213
**Category:** Elasticsearch
**Created:** [February 17, 2015, 4:42pm UTC](https://discuss.elastic.co/t/elasticsearch-asyncappender-configuration/22213 "2015-02-17T16:42:22Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Mohamed\_Amine\_ABDESS](https://avatars.discourse-cdn.com/v4/letter/m/77aa72/32.png) [@Mohamed\_Amine\_ABDESS](https://discuss.elastic.co/u/Mohamed_Amine_ABDESS)
#### Post date: [February 17, 2015, 4:42pm UTC](https://discuss.elastic.co/t/elasticsearch-asyncappender-configuration/22213/1 "2015-02-17T16:42:22Z")

</div>

We've set up elasticsearch logging as described here logging elasticsearch  
events with logstash  
[http://www.elasticsearch.org/blog/logging-elasticsearch-events-with-logstash-and-elasticsearch/](http://www.elasticsearch.org/blog/logging-elasticsearch-events-with-logstash-and-elasticsearch/) and  
we want to use an AsyncAppender instead of using a SocketAppender directly  
in order to avoid freeze times while logging but only xml log4j conf file  
format supports AsyncAppender.

Is there another way to achieve this since elasticsearch doesn't use xml  
conf files?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/095b157e-f2f4-4385-8205-dd9ff41f5f7e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/095b157e-f2f4-4385-8205-dd9ff41f5f7e%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)
#### Post date: [February 18, 2015, 8:12am UTC](https://discuss.elastic.co/t/elasticsearch-asyncappender-configuration/22213/2 "2015-02-18T08:12:09Z")

</div>

It's easy, just remove log4j jar and config/logging.yml, then add  
log4j2.xml, log4j-api, log4j-core, log4j-slf4j-impl and slf4j-api jars to  
the lib folder. Then you can set up async appenders with log4j2, which are  
18x more performant than log4j 1.x appenders.

Jörg

On Tue, Feb 17, 2015 at 5:42 PM, Mohamed Amine ABDESSEMED \<  
[amineini@gmail.com](mailto:amineini@gmail.com)\> wrote:

> We've set up elasticsearch logging as described here logging  
> elasticsearch events with logstash  
> [http://www.elasticsearch.org/blog/logging-elasticsearch-events-with-logstash-and-elasticsearch/](http://www.elasticsearch.org/blog/logging-elasticsearch-events-with-logstash-and-elasticsearch/) and  
> we want to use an AsyncAppender instead of using a SocketAppender directly  
> in order to avoid freeze times while logging but only xml log4j conf file  
> format supports AsyncAppender.
> 
> Is there another way to achieve this since elasticsearch doesn't use xml  
> conf files?
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/095b157e-f2f4-4385-8205-dd9ff41f5f7e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/095b157e-f2f4-4385-8205-dd9ff41f5f7e%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/095b157e-f2f4-4385-8205-dd9ff41f5f7e%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/095b157e-f2f4-4385-8205-dd9ff41f5f7e%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG2WCNunGdWx5VwytYUv-1TCWNgae%3DQixSwx9014HWpzw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG2WCNunGdWx5VwytYUv-1TCWNgae%3DQixSwx9014HWpzw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Mohamed\_Amine\_ABDESS](https://avatars.discourse-cdn.com/v4/letter/m/77aa72/32.png) [@Mohamed\_Amine\_ABDESS](https://discuss.elastic.co/u/Mohamed_Amine_ABDESS)
#### Post date: [February 18, 2015, 3:28pm UTC](https://discuss.elastic.co/t/elasticsearch-asyncappender-configuration/22213/3 "2015-02-18T15:28:47Z")

</div>

I can't see how removing the log4 jar and logging.yml will allow  
elasticsearch to init log4j2 using the xml conf file since the allowed  
suffixes are 'yml, yaml, json , properties' (  
[https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/common/logging/log4j/LogConfigurator.java#L48](https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/common/logging/log4j/LogConfigurator.java#L48))  
?

Amine

On Wednesday, February 18, 2015 at 9:12:15 AM UTC+1, Jörg Prante wrote:

> It's easy, just remove log4j jar and config/logging.yml, then add  
> log4j2.xml, log4j-api, log4j-core, log4j-slf4j-impl and slf4j-api jars to  
> the lib folder. Then you can set up async appenders with log4j2, which are  
> 18x more performant than log4j 1.x appenders.
> 
> Jörg
> 
> On Tue, Feb 17, 2015 at 5:42 PM, Mohamed Amine ABDESSEMED \<  
> [amin...@gmail.com](mailto:amin...@gmail.com) \<javascript:\>\> wrote:
> 
> > We've set up elasticsearch logging as described here logging  
> > elasticsearch events with logstash  
> > [http://www.elasticsearch.org/blog/logging-elasticsearch-events-with-logstash-and-elasticsearch/](http://www.elasticsearch.org/blog/logging-elasticsearch-events-with-logstash-and-elasticsearch/) and  
> > we want to use an AsyncAppender instead of using a SocketAppender directly  
> > in order to avoid freeze times while logging but only xml log4j conf file  
> > format supports AsyncAppender.
> > 
> > Is there another way to achieve this since elasticsearch doesn't use xml  
> > conf files?
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/095b157e-f2f4-4385-8205-dd9ff41f5f7e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/095b157e-f2f4-4385-8205-dd9ff41f5f7e%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/095b157e-f2f4-4385-8205-dd9ff41f5f7e%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/095b157e-f2f4-4385-8205-dd9ff41f5f7e%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/032b5dc8-fd5b-4714-948d-7fe74a63ee65%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/032b5dc8-fd5b-4714-948d-7fe74a63ee65%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)
#### Post date: [February 18, 2015, 4:39pm UTC](https://discuss.elastic.co/t/elasticsearch-asyncappender-configuration/22213/4 "2015-02-18T16:39:30Z")

</div>

If you remove the log4j jar, the ES logging is initialized by a logging  
facade called SLF4J, and this passes initialization to the underlying  
logging framework, e.g. log4j2

[https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/common/logging/ESLoggerFactory.java#L40](https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/common/logging/ESLoggerFactory.java#L40)

Jörg

On Wed, Feb 18, 2015 at 4:28 PM, Mohamed Amine ABDESSEMED \<  
[amineini@gmail.com](mailto:amineini@gmail.com)\> wrote:

> I can't see how removing the log4 jar and logging.yml will allow  
> elasticsearch to init log4j2 using the xml conf file since the allowed  
> suffixes are 'yml, yaml, json , properties' (  
> [https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/common/logging/log4j/LogConfigurator.java#L48](https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/common/logging/log4j/LogConfigurator.java#L48))  
> ?
> 
> Amine
> 
> On Wednesday, February 18, 2015 at 9:12:15 AM UTC+1, Jörg Prante wrote:
> 
> > It's easy, just remove log4j jar and config/logging.yml, then add  
> > log4j2.xml, log4j-api, log4j-core, log4j-slf4j-impl and slf4j-api jars to  
> > the lib folder. Then you can set up async appenders with log4j2, which are  
> > 18x more performant than log4j 1.x appenders.
> > 
> > Jörg
> > 
> > On Tue, Feb 17, 2015 at 5:42 PM, Mohamed Amine ABDESSEMED \<  
> > [amin...@gmail.com](mailto:amin...@gmail.com)\> wrote:
> > 
> > > We've set up elasticsearch logging as described here logging  
> > > elasticsearch events with logstash  
> > > [http://www.elasticsearch.org/blog/logging-elasticsearch-events-with-logstash-and-elasticsearch/](http://www.elasticsearch.org/blog/logging-elasticsearch-events-with-logstash-and-elasticsearch/) and  
> > > we want to use an AsyncAppender instead of using a SocketAppender directly  
> > > in order to avoid freeze times while logging but only xml log4j conf file  
> > > format supports AsyncAppender.
> > > 
> > > Is there another way to achieve this since elasticsearch doesn't use xml  
> > > conf files?
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > msgid/elasticsearch/095b157e-f2f4-4385-8205-dd9ff41f5f7e%  
> > > [40googlegroups.com](http://40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/095b157e-f2f4-4385-8205-dd9ff41f5f7e%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/095b157e-f2f4-4385-8205-dd9ff41f5f7e%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/032b5dc8-fd5b-4714-948d-7fe74a63ee65%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/032b5dc8-fd5b-4714-948d-7fe74a63ee65%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/032b5dc8-fd5b-4714-948d-7fe74a63ee65%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/032b5dc8-fd5b-4714-948d-7fe74a63ee65%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoE0M%3DY%2BSYXpJPLBzUKu6GGvpNOj4iOUhPX-TU-1XHS7LA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoE0M%3DY%2BSYXpJPLBzUKu6GGvpNOj4iOUhPX-TU-1XHS7LA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Cactusbone](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cactusbone/32/5816_2.png) [@Cactusbone](https://discuss.elastic.co/u/Cactusbone)
#### Post date: [November 9, 2015, 5:31pm UTC](https://discuss.elastic.co/t/elasticsearch-asyncappender-configuration/22213/5 "2015-11-09T17:31:28Z")

</div>

Hello ! Sorry about reviving this topic, but i'm trying to use asyncappender too and so i followed the remarks here.  
I seem to have log4j2 working, but can't use  
`${path.logs}/${cluster.name}_${node.name}`

I'm not sure how to get those variables, any hint ?

---

<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: [July 5, 2017, 11:39pm UTC](https://discuss.elastic.co/t/elasticsearch-asyncappender-configuration/22213/6 "2017-07-05T23:39:44Z")

</div>


