Error tracking in the cloud with lets you focus on building apps

​Learn how simplifies application error tracking and notifications by seeing how to integrate it with an ASP.NET app.


The number of avenues and options available for building and scaling web applications is surprising, especially when I reflect on the same task that years ago would require you to build a server, find a host, and basically manage all aspects of the application.

These days you can focus on building the application while leveraging services for everything from web hosting to data analytics. A good example is, which handles tracking application errors and notifies you when errors occur. Let's take a closer look at what offers by integrating it with an existing ASP.NET application.

Error tracking in the cloud

The site promises a setup time of five minutes; it took approximately 20 minutes for an ASP.NET application, but that included the time needed to set up a trial account with the site. The service is not free; they have a rate structure depending on number of applications, errors, and so forth. However, you can take it for a spin with a 30-day free trial (no credit card needed), which is what I use in this article.

Once an account is set up, you are ready to integrate the service into your application. It supports the following platforms: .NET (including ASP.NET), Android, iOS, Java, JavaScript, Node.js, PHP, Python, and Ruby on Rails. The online documentation provides details on the service as well as integrating with your code.

Before diving into the code, let's discuss setup on the side. The service organizes your logging into applications. You define an application by name and the technology being used. Figure A shows the initial screen presented when adding a new application to your account. You assign a name along with notification (via email) options. Figure B is presented once the Create Application button is selected. Figure C loads when the technology is selected (ASP.NET in this case).

Every application you create has a unique Application API Key that is used in your code for identification. The api key will appear on the screen shown in Figure C (at the top and in the step #3 area). Note, they have been removed in the examples to avoid reuse. Once you have the key value, it is time to configure the actual code to use the server. My first interaction with the service was in ASP.NET, so I'll show this approach.

Figure A


Creating a new application.

Figure B


Specifying the platform for your application.

Figure C


The final setup screen provides information on using the service.

Using the service in ASP.NET

The setup steps for the client or the code side are straightforward. These steps are spelled out each time a new application is created, as shown in Figure C. While my numbers do not directly correspond to their list, the following items provide the basics of using the service.

1. Install the package via NuGet in your application.

2. Add ConfigSections to your App.config (or Web.config for ASP.NET) for settings. In addition, the RaygunSettings element with the apikey attribute is added.

3. Choose whether you will use the service via code the global Application_Error event or add the HttpModule (called RaygunErrorModule) to the application via the system.web or system.webServer elements in the configuration file.

I used the service in the previously built NancyFX example that is hosted on Microsoft Azure. Figure D shows the NuGet Package Manager with package located (search for raygun4net) and installed. Once installed, you will see a reference to Mindscape.Raygun4Net package in the solution. The next step is configuring the application to use

Figure D


Locating and installing the NuGet package in Visual Studio.

The following listing has the complete web.config for the ASP.NET application using The three areas added to incorporate are in bold; this includes the addition of the RaygunSettings section, the RaygunErrorModule element within the system.webServer element, and the apikey identified in the RaygunSettings element. With the web.config changes saved, the application is now configured to use This sample application is hosted on Microsoft Azure, so I publish it once packages are installed and configuration changes saved.

<?xml version="1.0" encoding="utf-8"?>
<section name="RaygunSettings" type="Mindscape.Raygun4Net.RaygunSettings, Mindscape.Raygun4Net" />
 <compilation debug="true" targetFramework="4.5.1" />
<customErrors mode="Off" />
<httpRuntime targetFramework="4.5" />
 <validation validateIntegratedModeConfiguration="false" />
<httpErrors existingResponse="PassThrough" />
<add name="Nancy" verb="*" type="Nancy.Hosting.Aspnet.NancyHttpRequestHandler" path="*" />
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
<add name="RaygunErrorModule" type="Mindscape.Raygun4Net.RaygunHttpModule" />
<RaygunSettings apikey="f0f0f0f0f0f0f0f0f0f0f0f0" />
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="" newVersion="" />
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="" newVersion="" />

Processing errors

Once the application is configured, you will be notified of application errors via email (if configured), or you can visit the site to view application activity.

Figure E shows errors generated for this application. Notice that applications are categorized as Active, Resolved, Ignored, or Permanently Ignored. They are categorized when you drill into the individual errors as shown in Figure F; the dropdown list at the top right of the exception detail page allows you to appropriately mark it. In addition, the tabs shown at the bottom of Figure F allow you to drill into further error details, including the summary page displayed by default and Error Details, Request (details on HTTP request), and Raw Data (JSON view of the error data).

Figure E


Error activity recorded for the ASP.NET application.

Figure F


Individual error details along with dropdown to categorize.

Another piece of the puzzle

With all of the cloud services available today, you have everything necessary to piece together an application once you have an idea. For example, you can choose to host on AWS ( uses it) or Heroku with MongoLab for the backend database and process/analyze errors with a service like is not the only option with this type of service -- other options include Airbrake and Crashlytics -- but it is one that allows you to focus on building and maintaining code without the hassle of dealing with infrastructure (beyond managing cloud services).


Tony Patton has worn many hats over his 15+ years in the IT industry while witnessing many technologies come and go. He currently focuses on .NET and Web Development while trying to grasp the many facets of supporting such technologies in a productio...


This is certainly a step up. Mongo has already set in motion some good features, but Raygun does add to its allure by partition of their error alerts, crash notifications etc. and db/ infrastructure management. For those who just seek an 'application module' to let them check their code and customize it, it is a great tool. Remains to be seen how well it helps keep track of issues while also integrating a back-up of affected data. Perhaps something like 

Editor's Picks