One True Error

Have you ever been digging through log files just wondering what the root cause of the exception was? Most of the time there is not a lot of context to give you a clue. Last week I came across a great logging framework / tool. One True Error. It gives you a lot of extra context for your error, it analyzes your errors, etc. You can have visitors / testers fill in a form on the error page with even more information, which gets stored with the exception info. It’s open source and you can host the logging server yourself or have it hosted.

The best thing though is that you can add extra context. Just register a custom context info provider. You can for example add the EPiServer culture of the page the error occurred on, the complete serialized content of the page, maybe for commerce the current market, etc.

Something like this.

Dictionary<string, string> contextInfo = new Dictionary<string, string>
{
   {
       "PreferredCulture",
        ContentLanguage.PreferredCulture.Name
    },
   {
       "ContentId",
       contentRouteRouteHelper?.Content?.ContentLink.ID.ToString()
     },
    {
       "ContentData",
       contentRouteRouteHelper?.Content?.ToJson()
     }
  };

The full context info provider can be found on GitHub. I have also created a logging provider which will be available on NuGet when it gets approved. Or you can use the Log4Net appender OneTrueError provides.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s