Getting Started With NLog and Raygun

Daniel WylieProvider UpdatesLeave a Comment

NLog is a brilliant logging system that has been around in the .NET world for a while now. It’s useful in generating debug log files and spitting out exceptions. The biggest issue is that exceptions can get lost in all the text, and they’re hard to track. Now you can push exceptions straight from your existing code into Raygun.

We have just forked and updated NLog.Raygun, which provides a Raygun logging target for you to use. You can find it here.

nlog-and-raygun_blogcover_720x300px

Setting things up

You’ll need to checkout and build the code yourself, storing the DLL in a shared place for your projects.

Once you’ve included the DLL in your application, you need to add the new target to your NLog.config file. We recommend only listening for errors and above so you don’t end up with lots of debug messages in Raygun.

First, add NLog.Raygun to your extensions

Then setup your target, remembering to set your API key and any tags you want.

And last but not least, setup the rule to actually log to the Raygun target.

Now any exceptions that you’re logging will go to both Raygun and your other targets! Simple.

Next level software intelligence across your entire stack.

Leave a Reply

Your email address will not be published. Required fields are marked *