Home

ElmahR

What's ElmahR?

ElmahR is a web dashboard where you can aggregate several ASP.NET web applications you want to monitor in case they raise unhandled exceptions; adding them to the configuration of a dashboard instance will enable them to post error, which will be shown in real-time on all connected clients.

How does it work?

ElmahR is based on ELMAH for the error logging part, and on SignalR for the real-time notification piece.

In order to use ElmahR you have to enable ELMAH on the ASP.NET web application you have to monitor, and configure it to post errors to ElmahR. This way you'll leverage all the great logging features that ELMAH already has. To do that you will need the ErrorPostModule for ELMAH, which is part of ElmahR project and is not part of official ELMAH.

A monitored application in theory has not to be an ASP.NET application, it could be a desktop client, a mobile app, it could even be developed on a non-.NET platform, as long as it can post data over HTTP. Nevertheless the only fully implemented supported scenario is when applications to be monitored are ASP.NET web sites/applications. You can still implement different missing scenarios by yourself, it should be a quite easy task to do.

When an error arrives to ElmahR, after being posted as described earlier, ElmahR's server side code uses SignalR to redistribute it to all the connected clients. Errors reach clients as JSON structures resembling the ELMAH data format, and are finally processed to be visualized.

How is it structured?

Both client and server portions of ElmahR are modular. The Core portion takes care of basic error dispatching, and supplies a very basic textual log page, while the Dashboard module adds a more sophisticated and organized user interface, delivering real-time experience in form of error boxes smoothly appearing as soon as errors occur, and with simple statistics about how many errors have been observed. Error descriptions are clickable, causing an error details window to pop up. You can also do some basic client-side filtering: you can block error types you are not interested about, or stop error messages from specific applications, just click the play/pause icon corresponding to the error type or application you want to stop/resume.

More modules are available to tackle different problem contexts, like errors persistence or inversion of control.

How do I install ElmahR

Using ElmahR implies deploying a dashboard instance first, and then connecting the applications you want to monitor to the dashboard.

Preparing a Dashboard

A dashboard should be a separate applications from the monitored ones, you should not have the dashboard page directly inside an existing web application you want to monitor, although it is technically possible and not difficult. That's to keep things cleaner and safer. You will not need to install one dashboard for each monitored applications, a single dashboard can aggregate more than one source.

There are several available options to prepare a dashboard:

  • Geek option: Clone the code from this repository and compile it, the solution named ElmahR will give you a full dashboard.
  • Sysadmin option: Go to the downloads section to see if there is some packaged distribution ready. Those will be published every now and then to help figuring out how to set up a dashboard, reflecting the status of the code at the time of the publication. With the bits unzipped in a folder, you will create a web site or a virtual directory pointing at it, and configure it under an ASP.NET 4.0 app pool with integrated pipeline (you could also use IIS Express, especially for testing). Please follow the instructions available in the README inside the zipped file.
  • Nuget option (NEW! Available with 1.0.0 final): Create a new ASP.NET project (Webforms, MVC and Webpages are all supported), or use an existing one, and add the necessary ElmahR modules from Nuget. For more details about the available packages and how to use them please go to the corresponding section. Both .NET Framework 4.0 and 4.5 are supported.

Adding ErrorPostmodule to each web application to be monitored

ErrorPostModule is made available by ElmahR.Elmah assembly, and it's configured as any other ELMAH module. When properly configured it will extend ELMAH so that errors will be posted to the configured dashboard. For more details about how to configure it see the related section.

The assembly and the related module could be quite easily installed manually, but a Nuget package is available to make it even easier. The package will take care of the dependency on ELMAH and will prepare the configuration file appropriately. Please go to the Nuget packages section for more details.

How do I configure ElmahR

Now that you have everything in place, let's see how you can configure a dashboard and a monitored application. If you will use the Nuget packages you will have most of the configuration bits listed below already in place, you will only need to customize them with the actual values for your specific setup.

Dashboard

You will need to declare the configuration section first:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="elmahr" type="ElmahR.Core.Config.SectionHandler, ElmahR" />
  </configSections>

  ...

</configuration>

Then you will need the elmahr section and add to it as many application sections as the web apps you will want to monitor here:

  <elmahr>
    ...
    <application name="Sample application" 
                 sourceId="SomeCode" 
                 testExceptionUrl="http://foo.com/elmah.axd/test" />
    ...
  </elmahr>

The relevant thing here is the sourceId attribute, which will be used to match the corresponding source application.

Monitored app

Each monitored app will have ELMAH properly configured, and the ErrorPostModule from ElmahR.Elmah available, then you will need to configure properly:

<configuration>
  <configSections>
    <sectionGroup name="elmah">
      ...
      <section name="errorPost" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
    </sectionGroup>
  </configSections>
  <elmah>
    ...
    <errorPost targetUrl="http://dashbord.mycompany.com/posterror.axd" 
               sourceId="SomeCode" 
               infoUrl="http://foo.com/elmah.axd" />
  </elmah>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true">
      ...
      <add name="ErrorPost" type="ElmahR.Elmah.ErrorPostModule, ElmahR.Elmah" />
    </modules>
    ...
  </system.webServer>
  ...
</configuration>

The relevant things here are:

  • the ErrorPostModule module added to the available HTTP modules
  • the targetUrl attribute for the errorPost entry in elmah section, which is the address of the destination dashboard to which errors will be posted
  • the sourceId attribute for the errorPost entry in elmah section, which will be used to match the corresponding configured application in the dashboard

More details about all the available options can be found here.

Architecture

Details about ElmahR architecture can be found here.

More about Elmahr

Releases

Latest releases are available here.

1.1.2

  • Bug fixes in Nuget packages

1.1.0

  • Cross Domain support

1.0.2 & 1.0.3 & 1.0.4

  • Bug fixes

1.0.1 (Core only) (2013-03-29)

  • Bootstrap phase reviewed to better handle version 4.0 and 4.5 of .NET Framework
  • Dependencies reviewed

1.0.0 (2013-03-24)

  • Dashboard now is split in several modules, and has been reorganized accordingly
  • Nuget packages for dashboard modules available
  • Dashboard is extensible with new modules
  • CSS & JS bundling and minification introduced
  • Upgraded to SignalR 1.0
  • Replaceable IoC container for dependencies resolution (integrated with SignalR DependencyResolver)
  • Enhancements and bug fixes

0.9.7 (2012-11-11)

  • Error post encryption available

0.9.6.50000 (2012-10-24)

  • MongoDBPersistor released
  • Persistence writes happen asynchronously

0.9.4 (2012-09-17)

  • Historical errors stats and cleanup

0.9.3 (2012-09-03)

  • Low level logging

0.8.5 (2012-06-25)

  • Plugin system
  • Appharbor integration

0.7.5 (2012-06-13)

  • User setting persistence
  • SignalR groups implemented
  • Connection status diagnostics
  • ELMAH Test Exception support

...

Thanks

Big thanks to JetBrains for supporting ElmahR and other open-source projects by providing a free license for their awesome WebStorm IDE.

Updated

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.