# How do I log the APM headers in my dropwizard application

**URL:** <https://discuss.elastic.co/t/how-do-i-log-the-apm-headers-in-my-dropwizard-application/242631>\
**Category:** APM\
**Tags:** java\
**Created:** [July 26, 2020, 7:14am UTC](https://discuss.elastic.co/t/how-do-i-log-the-apm-headers-in-my-dropwizard-application/242631 "2020-07-26T07:14:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![manohar\_deepu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manohar_deepu/32/72797_2.png) [@manohar\_deepu](https://discuss.elastic.co/u/manohar_deepu)\
**Post date:** [July 26, 2020, 7:14am UTC](https://discuss.elastic.co/t/how-do-i-log-the-apm-headers-in-my-dropwizard-application/242631/1 "2020-07-26T07:14:58Z")

</div>

Hi,

I have a usecase where I want to log the apm related headers in my application log lines. My application is a simple dropwizard application , and in my config. yaml, I have configured this log fromat, I am not able to see the values in log lines

"%highlight(%-5level) %boldYellow([%d]) [%t] %green([%X{trace.id}]) %blue([%X{traceparent}]) %c - %m %ex%n"

Can you please tell me how to log the headers.

Also, can you please tell me how to explicitly access the headers in any application classes?

---

<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:** [July 26, 2020, 7:17am UTC](https://discuss.elastic.co/t/how-do-i-log-the-apm-headers-in-my-dropwizard-application/242631/2 "2020-07-26T07:17:33Z")

</div>

Hi and welcome to the forum!  
Try following the [log correlation documentation](https://www.elastic.co/guide/en/apm/agent/java/current/log-correlation.html).  
Did you set [`enable_log_correlation`](https://www.elastic.co/guide/en/apm/agent/java/current/config-logging.html#config-enable-log-correlation) to `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:** [August 16, 2020, 3:17am UTC](https://discuss.elastic.co/t/how-do-i-log-the-apm-headers-in-my-dropwizard-application/242631/3 "2020-08-16T03:17:38Z")

</div>

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