# How to write agent trace.id to application log file?

**URL:** <https://discuss.elastic.co/t/how-to-write-agent-trace-id-to-application-log-file/246414>\
**Category:** APM\
**Tags:** dotnet\
**Created:** [August 26, 2020, 8:55am UTC](https://discuss.elastic.co/t/how-to-write-agent-trace-id-to-application-log-file/246414 "2020-08-26T08:55:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wajika](https://avatars.discourse-cdn.com/v4/letter/w/977dab/32.png) [@wajika](https://discuss.elastic.co/u/wajika)\
**Post date:** [August 26, 2020, 8:55am UTC](https://discuss.elastic.co/t/how-to-write-agent-trace-id-to-application-log-file/246414/1 "2020-08-26T08:55:05Z")

</div>

I want to associate the log with apm metric through trace.id.

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [August 26, 2020, 9:28am UTC](https://discuss.elastic.co/t/how-to-write-agent-trace-id-to-application-log-file/246414/2 "2020-08-26T09:28:57Z")

</div>

Check out this guide: [https://www.elastic.co/guide/en/apm/agent/dotnet/current/log-correlation.html](https://www.elastic.co/guide/en/apm/agent/dotnet/current/log-correlation.html)

---

<div class="post-metadata">

**Author:** ![wajika](https://avatars.discourse-cdn.com/v4/letter/w/977dab/32.png) [@wajika](https://discuss.elastic.co/u/wajika)\
**Post date:** [August 27, 2020, 12:45am UTC](https://discuss.elastic.co/t/how-to-write-agent-trace-id-to-application-log-file/246414/3 "2020-08-27T00:45:36Z")

</div>

Thank you I found the document.

---

<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 16, 2020, 8:45pm UTC](https://discuss.elastic.co/t/how-to-write-agent-trace-id-to-application-log-file/246414/4 "2020-09-16T20:45:48Z")

</div>

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