# Log4j2 with Elasticsearch

**URL:** <https://discuss.elastic.co/t/log4j2-with-elasticsearch/79975>\
**Category:** Elasticsearch\
**Created:** [March 25, 2017, 2:56am UTC](https://discuss.elastic.co/t/log4j2-with-elasticsearch/79975 "2017-03-25T02:56:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajaram.p](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@rajaram.p](https://discuss.elastic.co/u/rajaram.p)\
**Post date:** [March 25, 2017, 2:56am UTC](https://discuss.elastic.co/t/log4j2-with-elasticsearch/79975/1 "2017-03-25T02:56:12Z")

</div>

Is there a option to send logs directly from log4j2 to elasticsearch?  
If not what else the option? I beleive logstash is not supporting log4j2 as of now..

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [March 31, 2017, 12:17pm UTC](https://discuss.elastic.co/t/log4j2-with-elasticsearch/79975/2 "2017-03-31T12:17:28Z")

</div>

It's possible, but it requires a lot of work, and it's not documented (and unlikely to be documented). We are actively working on making this easier.

---

<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:** [March 31, 2017, 9:25pm UTC](https://discuss.elastic.co/t/log4j2-with-elasticsearch/79975/3 "2017-03-31T21:25:00Z")

</div>

Have you tried my appenders?

Appending to Elasticsearch using port 9300 (version specific), latest is ES 1.7, not updated for quite a while)

> **[jprante/log4j2-elasticsearch](https://github.com/jprante/log4j2-elasticsearch)**
>
> log4j2-elasticsearch - Log4j2 Elasticsearch appender

or using HTTP over port 9200 (should work with all Elasticsearch versions)

> **[jprante/log4j2-elasticsearch-http](https://github.com/jprante/log4j2-elasticsearch-http)**
>
> log4j2-elasticsearch-http - Log4j2 Elasticsearch appender using the Java JDK HTTP client

---

<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:** [April 28, 2017, 9:25pm UTC](https://discuss.elastic.co/t/log4j2-with-elasticsearch/79975/4 "2017-04-28T21:25:07Z")

</div>

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