# Java spring boot log not displaying in apm-\* index

**URL:** <https://discuss.elastic.co/t/java-spring-boot-log-not-displaying-in-apm-index/267794>\
**Category:** APM\
**Tags:** java\
**Created:** [March 19, 2021, 10:21am UTC](https://discuss.elastic.co/t/java-spring-boot-log-not-displaying-in-apm-index/267794 "2021-03-19T10:21:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![suresh123](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@suresh123](https://discuss.elastic.co/u/suresh123)\
**Post date:** [March 19, 2021, 10:21am UTC](https://discuss.elastic.co/t/java-spring-boot-log-not-displaying-in-apm-index/267794/1 "2021-03-19T10:21:23Z")

</div>

Hello Experts,

We have 2 index application-logs-\* and apm-\*  
Application logs give more information about status and error.

The same error we would like to see from apm-\* index, bit we are not able to the complete java trace and error.

Does elastic APM for Java captures logs?

Regards,  
Suresh

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [March 21, 2021, 10:54am UTC](https://discuss.elastic.co/t/java-spring-boot-log-not-displaying-in-apm-index/267794/2 "2021-03-21T10:54:59Z")

</div>

If I understand correctly, you ingest both logs and APM traces into your Elasticsearch and you want to correlate APM traces/errors with related log data. If this is the case, take a look at [our log-correlation guide](https://www.elastic.co/guide/en/apm/agent/java/current/log-correlation.html). I assume you are at step 2.

Please notice that we just lately added an experimental feature that automatically reformats your application logs into ECS-JSON and includes the APM IDs in them, so that you don't need to configure your logging formatting (step 3 in the guide) - it will already be written in the proper format, ready for ingestion. Please take a look at the new [`log_ecs_reformatting`](https://www.elastic.co/guide/en/apm/agent/java/master/config-logging.html#config-log-ecs-reformatting) configuration and see if it fits your needs. If so, you would need to use the [latest snapshot](https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=co.elastic.apm&a=elastic-apm-agent&v=LATEST), as this was not released yet.

---

<div class="post-metadata">

**Author:** ![suresh123](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@suresh123](https://discuss.elastic.co/u/suresh123)\
**Post date:** [March 22, 2021, 2:09pm UTC](https://discuss.elastic.co/t/java-spring-boot-log-not-displaying-in-apm-index/267794/3 "2021-03-22T14:09:57Z")

</div>

```auto
Hi Eyal,

I have added below lines as environment variables, but application log is not appeared.
Let me know still what configuration i need to enable.

ELASTIC_APM_LOG_LEVEL: TRACE 
ELASTIC_APM_ENABLE_LOG_CORRELATION: true

```

---

<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 12, 2021, 10:09am UTC](https://discuss.elastic.co/t/java-spring-boot-log-not-displaying-in-apm-index/267794/4 "2021-04-12T10:09:59Z")

</div>

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