Page contents

log4net integration

The log4net library injects Coderr into the logging pipeline of log4net. Each time you log something and include an exception it will be reported to Coderr. This is by far the easiest way to use the power of Coderr in legacy applications (which use log4net).


You need to have installed the Coderr server somewhere and created an application in it. Once you've done that you'll have a appKey and a sharedSecret which you can configure below.

Add the following code somewhere before the first logger is retrieved.

var url = new Uri("http://yourServer/coderr/");
Err.Configuration.Credentials(url, "yourAppKey", "yourSharedSecret");

That's it.


If you have code like this:

catch (Exception ex)
	_logger.Debug("Failed doing some crazy stuff.", ex);

.. the exception will be picked up in Coderr.

As a bonus you will also see information about the log entry in Coderr:


Edit page at GitHub Create a documentation ticket Ask a question This page is generated using the open source project MarkdownWeb.