Motivation
If a property is added to the log scope multiple times, currently all its values are logged in metadata/labels. This is how log4net also behaves but in most of the cases it is undesired behavior. Only latest property value should be included (e.g., Serilog behaves the same way).
Example:
using (LogicalThreadContext.Stacks["Id"].Push("123"))
{
log.Info("Log 1"); // currently has "123" in the log metadata
using (LogicalThreadContext.Stacks["Id"].Push("456"))
{
log.Info("Log 2"); // currently has "123 456" in the log metadata; should have "456" instead
using (LogicalThreadContext.Stacks["Id"].Push("789"))
{
log.Info("Log 3"); // currently has "123 456 789" in the log metadata; should have "789" instead
}
}
}
Breaking change: yes (comparing to how log4net behaves by default)
Changes
Log latest property value
Update to the latest log4net version (2.0.17), this is required to use Peek() method
Update test names
Use file-scoped namespaces
Update readme to reflect the latest version of generated events
Motivation If a property is added to the log scope multiple times, currently all its values are logged in metadata/labels. This is how log4net also behaves but in most of the cases it is undesired behavior. Only latest property value should be included (e.g., Serilog behaves the same way).
Example:
Breaking change: yes (comparing to how log4net behaves by default)
Changes
Peek()
method