How to make exception reporting in log4net awesome.

Are you using log4net in an existing application and feel that you got no control over your errors? We’ve now created a seamless log4net integration. That means that we will automatically report all exceptions that you are logging.


In legacy applications you typically have services that handles business logic like the one below, where all exceptions are logged.

public class SomeService
    private ILog _logger = LogManager.GetLogger(typeof (SomeService));

    public void DoSomeStuff()
        catch (Exception ex)
            _logger.Error("Failed", ex);

The problem with that are that the errors are drowning in all other log noise. Until now it has been hard to address that without having to rewrite all those log statements.


With our solution you just have to add two lines of code to inject OneTrueError into the log4net pipeline:

class Program
    static void Main(string[] args)
        XmlConfigurator.Configure(new FileInfo("log4net.config"));

        // injects into the log4net pipeline
        //the rest of your app initialization

(You need to install our “onetrueerror.log4net” nuget package first.)

With that you got all our features including the dead easy email notifications:


Signup at OneTrueError today! It’s free.

  • eternalisresearch

    Being new to both log4net and One True Error, I’m a bit of a loss as to what log4net.config file would contain if all I want to do is send exceptions to One True Error. Do you have a complete example of how this might be integrated?

    Also, 95% of the links to the pages are returning only whitespace (no content).


    • Apologies for the late reply.

      1. The log4net adapter is typically only for those who have been using log4net to log exceptions. It’s just a way to get all those exceptions without having to rewrite the current code. If you have not used log4net previously I suggest that you use one of our other nuget packages.

      2. We’re running the blog in Azure and Microsofts host package for wordpress/PHP is flawed. The WinCache module crashes and I’ve tried to get them to fix it. Expect the blog to be moved from Azure.