# Elastic APM property elastic.apm.enable\_log\_correlation does not work

**URL:** <https://discuss.elastic.co/t/elastic-apm-property-elastic-apm-enable-log-correlation-does-not-work/198097>\
**Category:** APM\
**Created:** [September 4, 2019, 6:52pm UTC](https://discuss.elastic.co/t/elastic-apm-property-elastic-apm-enable-log-correlation-does-not-work/198097 "2019-09-04T18:52:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![surenraju](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/surenraju/32/62606_2.png) [@surenraju](https://discuss.elastic.co/u/surenraju)\
**Post date:** [September 4, 2019, 6:52pm UTC](https://discuss.elastic.co/t/elastic-apm-property-elastic-apm-enable-log-correlation-does-not-work/198097/1 "2019-09-04T18:52:30Z")

</div>

Elastic Search Version: 7.3.1  
APM Server Version: 7.3.1  
APM Client Version: 1.9.0

I am running APM Client agent along with Spring Boot based microservices. APM Client is able to instrument and able to collect traces, metric errors.

As part of the distributed tracing, i also wanted to trace.id and transaction.id in micro service logs. Our spring boot micro services use SLF4j and Logback.

I am using the property elastic.apm.enable\_log\_correlation=true to enable logging.

[https://www.elastic.co/guide/en/apm/agent/java/current/config-logging.html](https://www.elastic.co/guide/en/apm/agent/java/current/config-logging.html)

Logback configuration as follows

 { "trace.id" : "%X{trace.id}", "transaction.id" : "%X{transaction.id}" } 

But these configuration does not print any values for trace.id and transaction.id in my logs.

Is there dependency which i need to add to my spring boot project?

---

<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:** [September 5, 2019, 1:21am UTC](https://discuss.elastic.co/t/elastic-apm-property-elastic-apm-enable-log-correlation-does-not-work/198097/2 "2019-09-05T01:21:52Z")

</div>

Hi and welcome to the forum!

We will need much more info in order to know what is not working, like- the full configuration, the agent log in debug/trace levels, what _does_ work (eg can you get other MDC data printed to your logs) etc.

However, before all that, check out [this new project](https://github.com/elastic/java-ecs-logging) which allows for automatic logging of ECS-compatible JSON that include these APM data.  
We will love your feedback on it.

---

<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:** [September 25, 2019, 9:21pm UTC](https://discuss.elastic.co/t/elastic-apm-property-elastic-apm-enable-log-correlation-does-not-work/198097/3 "2019-09-25T21:21:55Z")

</div>

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