net-commons / common-logging

A portable logging abstraction for .NET
http://net-commons.github.io/common-logging
Apache License 2.0
649 stars 203 forks source link

Add support for Mapped Diagnostic Logical Context #107

Open karoberts opened 8 years ago

karoberts commented 8 years ago

NLog 4.1 supports adding context variables that survive across logical contexts (like async/await) where the thread might change but the context is the same.

https://github.com/NLog/NLog/wiki/MDLC-Layout-Renderer

It would be great if Common.Logging could somehow incorporate something like this so I don't have to make a call to an NLog class when using Common.Logging.

jgowdy commented 8 years ago

This would be huge for our team. I ended up writing my own assembly to abstract this out as we transition from log4net to NLog.

karoberts commented 8 years ago

I also ended up building my own using AsyncLocals.

pberggreen commented 7 years ago

It would be nice to be able to control if Common.Logging is using the Mapped Diagnostics Context and the new Mapped Diagnostic Logical Context.

snakefoot commented 5 years ago

Created #176 that adds support for MDLC + NDLC with NLog 4.5 (Includes custom build of nuget-package as attachment)