Migrating the elmah.io API to ASP.NET Core
We just launched a brand new version of our API. The big difference is that the API is now running on ASP.NET Core (instead of ASP.NET Web API). The new API is backward compatible with all of the existing integrations already using Elmah.Io.Client
version 3.x. If you are logging through packages like Elmah.Io
, Elmah.Io.AspNetCore
, Serilog.Sinks.ElmahIo
, or similar, you don't need to do anything. You are already running on the new API!
Here is a list of changes included in the new version:
ASP.NET Core
As mentioned previously, the new API is running on ASP.NET Core. We already see superior performance compared to the old version running on ASP.NET Web API.
Problem details
With ASP.NET Core, we get native support for Problem Details (rfc7807). In the past, returning errors from the API was based on a home-cooked solution that wasn't consistently implemented throughout all endpoints. Now all errors returned by the API include the application/problem+json
header and the body is formatted as an rfc7807 compliant error-object:
{
"title": "API key not found.",
"status": 401,
"detail": "API keys can be created on the organization settings page."
}
Switching return types is a breaking change, but not something that will hit anyone using one of the integrations. For help migrating to Problem Details, please reach out.
Improved documentation
The new API is running on the most recent version of Swagger UI. We have focused a lot on improving the existing documentation. The new Swagger UI page now contains a lot more help and explanations: https://api.elmah.io/swagger/index.html.
CORS
In the past, creating messages was the only endpoint possible to reach through CORS (like calling the elmah.io API from JavaScript). Now all endpoints support CORS, making it possible to create an elmah.io dashboard in JavaScript if you want.
As always, please reach out if you experience any problems or have feedback about the new API. We are here to help.
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