# Sending Java Logs to Elastic Search, an efficient way?

**URL:** <https://discuss.elastic.co/t/sending-java-logs-to-elastic-search-an-efficient-way/27475>\
**Category:** Elasticsearch\
**Created:** [August 17, 2015, 6:19am UTC](https://discuss.elastic.co/t/sending-java-logs-to-elastic-search-an-efficient-way/27475 "2015-08-17T06:19:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zeal\_Vora](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zeal_vora/32/3946_2.png) [@Zeal\_Vora](https://discuss.elastic.co/u/Zeal_Vora)\
**Post date:** [August 17, 2015, 6:19am UTC](https://discuss.elastic.co/t/sending-java-logs-to-elastic-search-an-efficient-way/27475/1 "2015-08-17T06:19:11Z")

</div>

Hi

We are planning to have centralized logging system and have been sending Linux related logs to Elastic Search and searching them via Kibana.

We were planning to send Java LOGS as well. So was wondering, is it efficent to send whole Java log to Elastic Search and access them via Kibana ?

We were planning to remove the Developer's access into the servers, so they will have to go to Kibana to see and go through their logs.

What would be a right way to do this ?

Thanks

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 17, 2015, 6:20am UTC](https://discuss.elastic.co/t/sending-java-logs-to-elastic-search-an-efficient-way/27475/2 "2015-08-17T06:20:38Z")

</div>

You can definitely do this with Logstash.

---

<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:** [August 17, 2015, 7:14am UTC](https://discuss.elastic.co/t/sending-java-logs-to-elastic-search-an-efficient-way/27475/3 "2015-08-17T07:14:35Z")

</div>

Not sure what you mean by "Java logs", maybe stack traces? If you use log4j2 you can try my appender at [https://github.com/jprante/log4j2-elasticsearch](https://github.com/jprante/log4j2-elasticsearch)

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [August 17, 2015, 7:43am UTC](https://discuss.elastic.co/t/sending-java-logs-to-elastic-search-an-efficient-way/27475/4 "2015-08-17T07:43:00Z")

</div>

[https://github.com/logstash/log4j-jsonevent-layout](https://github.com/logstash/log4j-jsonevent-layout) is a Log4j layout that produces Logstash-friendly JSON that I prefer strongly to writing a series of Logstash filters for parsing a "normal" human-readable text log (especially since there's no standard format for those).

---

<div class="post-metadata">

**Author:** ![otisg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/otisg/32/492_2.png) [@otisg](https://discuss.elastic.co/u/otisg)\
**Post date:** [August 20, 2015, 10:16pm UTC](https://discuss.elastic.co/t/sending-java-logs-to-elastic-search-an-efficient-way/27475/5 "2015-08-20T22:16:44Z")

</div>

Hi,

This should help with multi-line logs, like Java stack exception traces: [http://blog.sematext.com/2015/05/26/handling-stack-traces-with-logstash/](http://blog.sematext.com/2015/05/26/handling-stack-traces-with-logstash/)

## Otis

Monitoring \* Alerting \* Anomaly Detection \* Centralized Log Management  
Solr & Elasticsearch Support \* [http://sematext.com/](http://sematext.com/)

---

<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:54pm UTC](https://discuss.elastic.co/t/sending-java-logs-to-elastic-search-an-efficient-way/27475/6 "2017-07-05T23:54:45Z")

</div>


