patriksvensson / blackbox

A logging library inspired by log4net, targeting .NET Framework 4 Client Profile.
http://blackbox-project.org
GNU General Public License v3.0
6 stars 0 forks source link

Log contexts #14

Open patriksvensson opened 13 years ago

patriksvensson commented 13 years ago

There is a need for contexts that are associated with different scopes. The context can be used to attach arbitrary data, and use this data in sinks, format providers or condition expressions.

There will be three scopes available.

// Example code
logger.Contexts.Thread.Set("CustomerId", customer.Id);
logger.Contexts.Global.Set("UseEncryption", true);