An open API service indexing awesome lists of open source software.

https://github.com/romkatv/nlogevents

OnLog event for NLog
https://github.com/romkatv/nlogevents

dotnet nlog

Last synced: 7 months ago
JSON representation

OnLog event for NLog

Awesome Lists containing this project

README

          

# NLogEvents

This .NET library defines an event that triggers whenever a log record is sent
to [NLog](https://github.com/NLog/NLog). It provides an easy to use API for
intercepting logs.

## Usage

1. Add a nuget dependency on
[NLog.Events](https://www.nuget.org/packages/NLog.Events/).
2. Define a target with type `OnLogEvent` in your `NLog.config`, and a rule that
sends some logs to it.
3. Subscribe to `NLogEvents.Events.OnLog` event. It'll fire whenever a log
record is sent to the `OnLogEvent` you've defined.

See [Example](https://github.com/romkatv/NLogEvents/blob/master/Example).