API v2 Beta Released

Since writing this post, the v2 API has been removed. Check out API v3 for updated details on our API.

At elmah.io we believe in open APIs. That’s why we have offered an API to create errors and query them pretty much from the day of the first alpha. Unfortunately the API have been very tight coupled with ELMAHs ErrorXml format, which makes it hard to integrate to elmah.io without having extensive knowledge about the internals of ELMAH itself. Well, not anymore! Please welcome the API v2 beta.

So why a new API at all? As mentioned in the beginning, logging to the elmah.io V1 API requires you to generate a body containing the error in ELMAHs error XML format. While it would be possible to generate the XML by hand, you would probably always end up referencing the elmah.corelibrary NuGet package which contains strongly typed classes to actually generate the XML. If you are logging to ELMAH from an ASP.NET website, you are already referencing elmah.corelibrary, but if you want to log messages to elmah.io from something else, you probably don’t want to reference packages dependent of System.Web.

API Browser

So how does the new API differ? First of all we’ve switched to JSON and a much purer REST implementation. Second, the error XML have been replaced with a custom format which we simply call Message. A message is unlike Error from V1, simply a wrapper for logging and retrieving data to and from elmah.io. ELMAH doesn’t contain the concept of a severity like most other logging frameworks. This is not a bug, but caused by the fact that ELMAH focuses around errors. Message has the concept of severity which means that you can start logging other types of information to elmah.io like Debug and Information.

In the next months, we will improve the support for severities on the elmah.io website as well as release a strongly typed client for the v2 API. When we feel comfortable about the new API, we will switch the elmah.io client to use the new API as well.

elmah.io: Error logging and Uptime Monitoring for your web apps

This blog post is brought to you by elmah.io. elmah.io is error logging, uptime monitoring, deployment tracking, and service heartbeats for your .NET and JavaScript applications. Stop relying on your users to notify you when something is wrong or dig through hundreds of megabytes of log files spread across servers. With elmah.io, we store all of your log messages, notify you through popular channels like email, Slack, and Microsoft Teams, and help you fix errors fast.

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