Transforming events


Transforming extensions allows a particular ILog instance to modify some of incoming log events.

Transform log level

Transform log levels of incoming log events according to provided mapping:

log = log.WithLevelsTransformation(
new Dictionary<LogLevel, LogLevel>
[LogLevel.Error] = LogLevel.Warn,
[LogLevel.Fatal] = LogLevel.Warn

Transform error log level of incoming log events to warning level:

log = log.WithErrorsTransformedToWarns();