# .NET Core API Log correlation not showing in transactions

**URL:** <https://discuss.elastic.co/t/net-core-api-log-correlation-not-showing-in-transactions/293747>\
**Category:** Logs\
**Tags:** language-clients\
**Created:** [January 7, 2022, 1:21pm UTC](https://discuss.elastic.co/t/net-core-api-log-correlation-not-showing-in-transactions/293747 "2022-01-07T13:21:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gonzaloluna](https://avatars.discourse-cdn.com/v4/letter/g/ea666f/32.png) [@gonzaloluna](https://discuss.elastic.co/u/gonzaloluna)\
**Post date:** [January 7, 2022, 1:21pm UTC](https://discuss.elastic.co/t/net-core-api-log-correlation-not-showing-in-transactions/293747/1 "2022-01-07T13:21:48Z")

</div>

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?

 ![Capture](https://us1.discourse-cdn.com/elastic/original/3X/5/1/51cf3fe2a47bb2b221c70b15a8a3ded38eb8226a.jpeg)  
Here is my NLog config

```auto

<?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.org/schemas/NLog.xsd NLog.xsd"
      autoReload="true"
      throwExceptions="false"
      internalLogLevel="Off" internalLogFile="nlog-internal.log">

    <extensions>
      <add assembly="Elastic.Apm.NLog"/>
      <add assembly="Elastic.CommonSchema.NLog"/>
      <add assembly="NLog.Web.AspNetCore"/>
    </extensions>
  <targets>
    
  <target name="console"
            type="console"
            layout="${ElasticApmTraceId}|${ElasticApmTransactionId}|${ElasticApmSpanId}|${message}" />
  
    <target type="file" name="logfile" fileName="myfile.txt" >
      <layout type="jsonlayout">
        <attribute name="TraceId" layout="${ElasticApmTraceId}" />
        <attribute name="TransactionId" layout="${ElasticApmTransactionId}" />
        <attribute name="Date" layout="${longdate}" />
        <attribute name="Level" layout="${uppercase:${level}}" />
        <attribute name="Logger" layout="${logger}" />
        <attribute name="Message" layout="${message} ${exception:format=tostring}" />
      </layout>
    </target>
  </targets>
  
  <rules>
    <logger name="*" minLevel="Debug" writeTo="Console" />
    <logger name="*" minLevel="Trace" writeTo="logfile" />
  </rules>
</nlog>

```

---

<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 4, 2022, 1:22pm UTC](https://discuss.elastic.co/t/net-core-api-log-correlation-not-showing-in-transactions/293747/2 "2022-02-04T13:22:12Z")

</div>

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