Supporting NLog 4.5 and structured logging

NLog 4.5 were published a little over a week ago and we want to show our support with a compatible version too. As of today, our integration (Elmah.Io.NLog) runs on NLog 4.5 and also supports the new structured logging feature available in 4.5.

All samples have been updated to NLog 4.5 and there's a new ASP.NET Core 2.0 sample available here: https://github.com/elmahio/elmah.io.nlog/tree/master/samples.

You may know structured logging from similar logging frameworks like Serilog. The awesome thing about structured log messages is, that you put semantic meaning directly in log messages, rather than a dumb string concat. Let's look have a quick look at how a structured NLog message look like:

logger.LogWarning("Endpoint requested with HTTP {method}", Request.Method);

Looking at the warning inside elmah.io, simply shows the full message:

NLog warning

When digging into the warning details, you will see the key (method) and value (GET) inside the Data tab:

Data tab

Keeping properties separated from the actual log message, opens a range of possibilities, like enhanced search.

Let us know if you experience any problems with the new version.



Features steps
We monitor your websites

We monitor your websites

We monitor your websites for crashes and availability. This helps you get an overview of the quality of your applications and to spot trends in your releases.

We notify you

We notify you

We notify you when errors starts happening using Slack, HipChat, mail or other forms of communication to help you react to errors before your users do.

We help you fix bugs

We help you fix bugs

We help you fix bugs quickly by combining error diagnostic information with innovative quick fixes and answers from Stack Overflow and social media.

See how we can help you monitor your website for crashes Monitor your website