In our API when we are writing the logs we are adding ActivityId. It is created in Application_BegingRequest but for few call it didn't write any ActivityId and it seems it did not fire Application_BeginRequest method in Global.asax.
Please find the details below :
Code in Global.asax:
protected void Application_BeginRequest(object sender, EventArgs e)
{
Trace.CorrelationManager.ActivityId = Guid.NewGuid();
}
configuration for logs:
<target name="logfile" xsi:type="File" fileName="./Logs/${shortDate}.log" layout="${time} | ${activityid} | ${identity} | ${callsite:className=true:includeSourcePath=true:methodName=true:includeNamespace=false} | ${level:uppercase=true} | ${message} ${exception}" />
can some please help me on this issue.