.Net supports logical thread ids for asynchronous operations that may execute over multiple thread pool threads. This is provided via the System.Diagnostics.Trace.CorrelationManager.ActivityId property. .Net always ensures the ActivityId gets propagated across Begin/End async calls as well as QueueUserWorkItem operations. It is often a best practice to also include the ActivityId over network RPC operations so the logical thread/operation can be tracked in a distributed system.
This commit adds the ActivityIdLayoutRenderer to simply write this value out if the user desires. It is derived from the original GuidLayoutRenderer. Much appreciated!
Add support for logging .Net logical thread ActivityIds.
Wow, thanks - I never heard of this ActivityId property. It will probably turn out very useful for me some day :)
Happy to help! It's incredibly useful when analyzing and merging massive amounts of logs from a cluster.
Yep, I'm actually using a thingie of my own for that; in case you're interested: https://github.com/jkff/greg , http://code.google.com/p/greg/ (with an NLog appender of course - however the .NET version belongs to my employer; only Java and Haskell I opensourced)
Merge remote-tracking branch 'upstream/master'
Why hasn't this been merged?