NLogEvents
This .NET library defines an event that triggers whenever a log record is sent to NLog. It provides an easy to use API for intercepting logs.
Usage
- Add a nuget dependency on NLog.Events.
- Define a target with type
OnLogEvent
in yourNLog.config
, and a rule that sends some logs to it. - Subscribe to
NLogEvents.Events.OnLog
event. It'll fire whenever a log record is sent to theOnLogEvent
you've defined.
See Example.