How to Configure ELMAH
  • Updated on 15 Jul 2019
  • 1 minute to read
  • Contributors
  • Print
  • Share
  • Dark
    Light

How to Configure ELMAH

  • Print
  • Share
  • Dark
    Light

Start logging errors using Error Logging Modules and Handlers (ELMAH) appender with minimal changes to your project. Add a few Dynamic-link libraries (DLLs) and add configuration details to the .config file specifying an additional (or replacement) appender.

Getting Started Using NuGet

For NuGet from Visual Studio, integrate the Stackify ELMAH or ELMAH MVC Appender libraries and configurations. Search Stackify and install Stackify ELMAH Appender or Stackify ELMAH MVC Appender (depending on your application type).

Or you can install directly from the Package Manager Console using:

Install-Package StackifyLib.Elmah
    or
Install-Package StackifyLib.Elmah.MVC

Configuring with NuGet

To complete the NuGet installation, copy your Stackify Activation Key (license key) from your Retrace Account Info page and paste it during installation. Once done, the installation and configuration of the Stackify ELMAH Appender are complete.

Error Results on Non-Monitored Servers

For error logging from a server that does not have a Stackify monitoring agent, add an Environment key to the appSettings section of your configuration.

For logging errors in an application that does not appear in the App Stacks page, check error results using the global Error Dashboard page. There will be no App Dashboard for that application if it is not installed on a server that is being monitored.

Here is an example of the settings needed for logging errors from an unmonitored server:

<appSettings>
    <add key="Stackify.ApiKey" value="Your Activation Key" />
    <add key="Stackify.AppName" value="Your App Name"/>
    <add key="Stackify.Environment" value="Your Environment"/> <!-- optional - inferred by Stackify if running on a monitored server -->
</appSettings>

To indicate a correct setup, you should receive similar logs in Retrace the way it appears on your localhost, as shown below:

image.png

Troubleshooting

If you are still having trouble getting started, follow our Troubleshoot: Errors and Logs .NET Configurations guide to address common issues.

Was this article helpful?