Outputs the Trace.CorrelationManager.ActivityId
as trace correlation id.
Platforms Supported: All - Requires nuget-package NLog.Targets.Trace since NLog v6
Introduced in NLog v4.1.
⚠️ Trace.CorrelationManager.ActivityId is now considered legacy and instead replaced by System.Diagnostics.Activity. See also: ${activity}
If the Trace.CorrelationManager.ActivityId
is equal to Guid.Empty
, then appends String.Empty
, otherwise appends Trace.CorrelationManager.ActivityId
as separated by hyphens according to the CultureInfo.InvariantCulture
.
For an ASP.NET IIS application, initialize the Trace.CorrelationManager.ActivityId
in the Global.asax.cs
, Application_BeginRequest
event:
protected void Application_BeginRequest(object sender, EventArgs e) { ... if (Trace.CorrelationManager.ActivityId == Guid.Empty) { Trace.CorrelationManager.ActivityId = Guid.NewGuid(); } }
Notice IIS Express might automatically setup ActivityId
without needing the above code.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4