# .NET Core NLog correlation not showing when using Auto Instrumentation (Profiler) or Zero code change (startup hook)

**URL:** <https://discuss.elastic.co/t/net-core-nlog-correlation-not-showing-when-using-auto-instrumentation-profiler-or-zero-code-change-startup-hook/319089>\
**Category:** APM\
**Tags:** dotnet, language-clients\
**Created:** [November 16, 2022, 2:28pm UTC](https://discuss.elastic.co/t/net-core-nlog-correlation-not-showing-when-using-auto-instrumentation-profiler-or-zero-code-change-startup-hook/319089 "2022-11-16T14:28:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![karpediemnow](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karpediemnow/32/113241_2.png) [@karpediemnow](https://discuss.elastic.co/u/karpediemnow)\
**Post date:** [November 16, 2022, 2:28pm UTC](https://discuss.elastic.co/t/net-core-nlog-correlation-not-showing-when-using-auto-instrumentation-profiler-or-zero-code-change-startup-hook/319089/1 "2022-11-16T14:28:55Z")

</div>

HI,  
following the documentation about Log correlation ( [Link](https://www.elastic.co/guide/en/apm/agent/dotnet/current/nlog.html) )

I have added the Elastic.Apm.NLog.dll and the following entries into NLog.config file  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/2/327fb7ac708c7902b72b6673669ea68f10473b2f.png)

but the ElasticApmTraceId and ElasticApmTransactionId are not showing in the log ☹

I'm using [elastic\_apm\_profiler\_1.18.0](https://github.com/elastic/apm-agent-dotnet/releases/download/v1.18.0/elastic_apm_profiler_1.18.0.zip) and [Elastic.Apm.NLog v 1.5.3](https://www.nuget.org/packages/Elastic.Apm.NLog).

Could it be a version mismatch?

Thanks

---

<div class="post-metadata">

**Author:** ![karpediemnow](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karpediemnow/32/113241_2.png) [@karpediemnow](https://discuss.elastic.co/u/karpediemnow)\
**Post date:** [December 5, 2022, 7:30pm UTC](https://discuss.elastic.co/t/net-core-nlog-correlation-not-showing-when-using-auto-instrumentation-profiler-or-zero-code-change-startup-hook/319089/2 "2022-12-05T19:30:14Z")

</div>

Upper!

---

<div class="post-metadata">

**Author:** ![karpediemnow](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karpediemnow/32/113241_2.png) [@karpediemnow](https://discuss.elastic.co/u/karpediemnow)\
**Post date:** [December 27, 2022, 9:27am UTC](https://discuss.elastic.co/t/net-core-nlog-correlation-not-showing-when-using-auto-instrumentation-profiler-or-zero-code-change-startup-hook/319089/3 "2022-12-27T09:27:41Z")

</div>

No replies 😕 other users have the same problem

> [@.NET Core API Log correlation not showing in transactions](https://discuss.elastic.co/t/net-core-api-log-correlation-not-showing-in-transactions/293747):
>
> Hi I'm trying to make log correlation work on my NET Core API. I'm using NLog following the documentation. I'm getting the traceID and transactionID in the logs in my console and logfile but I have zero logs in any APM Transactions. What am I missing? Here is my NLog config \<?xml version="1.0" encoding="utf-8" ?\> \<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.nlog-project…

I'm start thinking that kibana stack isn't the best tools for monitoring .net core applications...

Hope I'm wrong

Best Regards

---

<div class="post-metadata">

**Author:** ![Wolfgang\_Ziegler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfgang_ziegler/32/109929_2.png) [@Wolfgang\_Ziegler](https://discuss.elastic.co/u/Wolfgang_Ziegler)\
**Post date:** [December 27, 2022, 10:32am UTC](https://discuss.elastic.co/t/net-core-nlog-correlation-not-showing-when-using-auto-instrumentation-profiler-or-zero-code-change-startup-hook/319089/4 "2022-12-27T10:32:51Z")

</div>

Hi @karpediemnow,

thanks for reaching out and please excuse the delayed response. It should not happen but your question has slipped through.

Can I ask you to provide agent logs for your application (see [here](https://www.elastic.co/guide/en/apm/agent/dotnet/current/troubleshooting.html))?  
If you want you can also open an issue in our [GitHub repository](https://github.com/elastic/apm-agent-dotnet).

Please note that there might be a delay in answering due to the holiday season.

Wolfgang

---

<div class="post-metadata">

**Author:** ![karpediemnow](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karpediemnow/32/113241_2.png) [@karpediemnow](https://discuss.elastic.co/u/karpediemnow)\
**Post date:** [January 12, 2023, 1:46pm UTC](https://discuss.elastic.co/t/net-core-nlog-correlation-not-showing-when-using-auto-instrumentation-profiler-or-zero-code-change-startup-hook/319089/5 "2023-01-12T13:46:34Z")

</div>

Hi @Wolfgang_Ziegler  
this are the log files (trace):

[Elastic.Apm.Profiler.Managed\_dotnet\_8.log](https://pastebin.com/dFWRQ2hi)  
[Elastic.Apm.Profiler.Managed.Loader\_dotnet\_8.log](https://pastebin.com/j6U0T2u9)  
Splitted:  
File elastic\_apm\_profiler\_dotnet\_8.log  
[FILE 1](https://pastebin.com/U5SBWqLc)  
[FILE 2](https://pastebin.com/9zXhsdjP)

I already have opened a issue on [elastic/ecs-dotnet](https://github.com/elastic/ecs-dotnet/issues).  
Needs to be duplicated on apm-agent-dotnet?  
Where do you think is the right place?

Thanks

---

<div class="post-metadata">

**Author:** ![Wolfgang\_Ziegler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfgang_ziegler/32/109929_2.png) [@Wolfgang\_Ziegler](https://discuss.elastic.co/u/Wolfgang_Ziegler)\
**Post date:** [January 16, 2023, 2:51pm UTC](https://discuss.elastic.co/t/net-core-nlog-correlation-not-showing-when-using-auto-instrumentation-profiler-or-zero-code-change-startup-hook/319089/6 "2023-01-16T14:51:41Z")

</div>

Hi @karpediemnow,

yes, [elastic/ecs-dotnet](https://github.com/elastic/ecs-dotnet/issues) looks like the right place this.

Thanks  
Wolfgang

---

<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:** [February 13, 2023, 2:52pm UTC](https://discuss.elastic.co/t/net-core-nlog-correlation-not-showing-when-using-auto-instrumentation-profiler-or-zero-code-change-startup-hook/319089/7 "2023-02-13T14:52:17Z")

</div>

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