How to use Elmah for error logging in ASP.Net Core

Take advantage of Elmah logging framework and the Elmah.io log monitoring service to manage errors in your ASP.Net Core application

Become An Insider

Sign up now and get FREE access to hundreds of Insider articles, guides, reviews, interviews, blogs, and other premium content. Learn more.

Error management is an integral part of any application. Elmah (which stands for Error Logging Modules and Handlers) is a pluggable error management framework. Because Elmah can be used to attach error logging capabilities to your application without having to re-compile or re-deploy, it makes the process of detecting application errors almost seamless.

In this article we’ll look at how to implement error management in ASP.Net Core using the Elmah error management framework and Elmah.io, a cloud-based error management system that works with Elmah. Elmah.io indexes all your errors for searching and provides a dashboard for issue tracking. Plus Elmah.io integrates nicely with many other popular logging frameworks including NLog and Log4net.

Elma.io pricing starts at $26 per month, after a 21 day free trial. To leverage Elmah.io in your ASP.Net Core application, start by creating an account and setting up a log. To create the log, you can take a look at the Elma.io documentation available here for reference. The next step is to install the necessary packages in your ASP.Net Core application as discussed in the section that follows.

Creating an ASP.Net Core application

Assuming that you’re running Visual Studio Community Edition 2017 and .Net Core is already installed in your system, you can take advantage of the steps that follow to create an ASP.Net Core application. Note that Elmah is not compatible with ASP.Net Core 1.0. We will use ASP.Net Core 2.0 in this example.

To continue reading this article register now