Error logging for ASP.NET Core

Best in class crash management for ASP.NET Core

Every exception, with the request that caused it

With elmah.io, monitoring your ASP.NET Core application requires no more than a few lines of configuration. We automatically pick up all errors on your website and log them to a log on elmah.io.

Errors are decorated with a lot of contextual information to help you to fix each error. Server variables, cookies, and form values can play an essential part in debugging why an error is happening. Using our well-documented NuGet package for ASP.NET Core, appending custom variables is a piece of cake.

Using rules and apps available on elmah.io, ignoring errors generated by bots, or notifying your team on Slack or Microsoft Teams are easily added using a few mouse clicks.

Health checks and uptime monitoring

ASP.NET Core introduced the new concept of health checks. Using health checks, your application continuously verifies its own state by executing a set of predefined rules. With the elmah.io integration for ASP.NET Core Health Checks, failing health checks are automatically logged as failing heartbeats on elmah.io.

With elmah.io Uptime Monitoring, you are notified as soon as your application starts failing. By combining Uptime Monitoring with ASP.NET Core Health Checks, you are told exactly why your endpoints are failing. You won't believe the difference in time-to-fix when going from "Your website failed with a status code of 500" to "Your website failed because it couldn't connect to the database".

Structured logging with Microsoft.Extensions.Logging

Logging uncaught exceptions is one thing. What about all of the log statements that developers need to add today? With our integration with Microsoft.Extensions.Logging, you can log everything from verbose to fatal messages from ASP.NET Core.

Since messages logged through Microsoft.Extensions.Logging goes in the same error log as uncaught errors, existing rules and notifications just work.

The elmah.io integration for Microsoft.Extensions.Logging supports structured logging. If you ever tried scrolling through file-based log files, you know how important being able to separate and search by properties can be.

Let your AI agent read your ASP.NET Core errors

Connect Claude Code, Cursor, VS Code or Visual Studio to the elmah.io MCP server. Your agent can list new errors, read the stack trace and request details, check what changed after a deployment, and mark an error as fixed when you ask.

AI chat - example conversation
What new errors did version 2.4.1 introduce in production?
Two new error groups since 2.4.1 was deployed 40 minutes ago. The biggest is a NullReferenceException in OrderService.Calculate, 112 occurrences, all on /checkout. The stack trace points to line 88.

In Claude Code, add the server with one command:

claude mcp add --transport http --client-id claudecode elmahio https://mcp.elmah.io/mcp

The MCP server is included on every plan and is currently in beta. Set up the MCP server.

elmah.io vs. ElmahCore

Feature ElmahCore elmah.io
Error Logging
Self-hosted
Cloud-hosted
Search
New error detection
Error grouping
Issue tracking
Microsoft.Extensions.Logging
Clientside error logging
Slack/Microsoft Teams/etc.
Deployment tracking
Uptime monitoring
Heartbeats
AI agent access (MCP server)

Set up in a few lines

Install the NuGet package, add your API key and log ID, and call UseElmahIo. That is the whole setup.

dotnet add package Elmah.Io.AspNetCore
builder.Services.AddElmahIo(options =>
{
    options.ApiKey = "API_KEY";
    options.LogId = new Guid("LOG_ID");
});

// ...

app.UseElmahIo();

Call UseElmahIo after UseExceptionHandler and UseAuthentication, and before your endpoints. Your API key and log ID are shown on the install page when you sign up. Read the full setup guide.

How it looks

Here is what elmah.io logs for an unhandled exception:

An unhandled exception in elmah.io, with the request and the stack trace.

Frequently asked questions

Does elmah.io work with minimal APIs?

Yes. UseElmahIo works with minimal APIs, MVC, Razor Pages and Web API controllers. The Elmah.Io.AspNetCore repository has a minimal API sample.

Yes. Install Elmah.Io.Extensions.Logging to send ILogger messages to the same log as your uncaught exceptions. Messages logged through ILogger use the same rules and notifications.

ElmahCore is self-hosted: it runs inside your app and shows errors on a page you host yourself. elmah.io is cloud-hosted and adds search, error grouping, new error detection, notifications, uptime monitoring and AI agent access. See the comparison table above.

Yes. The elmah.io package doesn't depend on Application Insights, so both can run in the same app.

Yes. Connect the elmah.io MCP server to Claude Code, Cursor, VS Code or Visual Studio. It is included on every plan and is currently in beta.

Get started with elmah.io
elmah.io is the easy error logging and uptime monitoring service for .NET. Take back control of your errors with support for all .NET web and logging frameworks.
Start logging now
Free 21-day trial No credit card required