Configure ELMAH on your site

PREREQUISITES: Your Microsoft SQL Server must be version 2000 or above.

  1. Install the ELMAH on SQL Server package from the NuGet repository.

    NOTE: ELMAH on SQL Server package is version 1.2. It has a dependency to the ELMAH package, which must be version 1.2.2. You can also install the ELMAH NuGet package, version 1.2.2, from the NuGet repository.

  2. Make sure the elmah section group is added inside the <configSections> tag in the web.config file. If not, add the section group manually:

    NOTE: Мake sure the Elmah.dll fileis loaded in the bin folder of your Sitefinity CMS web application.

  3. Complete the installation of the ELMAH.SqlServer:
    1. Create a new database to host ELMAH.
    2. Run the Elmah.SqlServer.sql script against an empty ELMAH database.

      NOTE: You can find the script in the ELMAH GitHub repository Downloads section. Download the Sources ZIP file.

  4. Open the web.config file of your application and perform the following transformations:
  5. (Optional) To send email notifications for each error at the time it occurs, you must configure your SMTP settings.

    If you do not have an SMTP server, you can download the open source smtp4dev and configure it to listen on port 26
    To do this, in your web.config file, after the <configSections> tag, add the following:

  6. (Optional) Register ELMAH handler by adding the following code line in the <handlers> and the <httpHandlers> sections in the web.config file:

    For more information about the ELMAH error logging handler, see Test error logging with ELMAH.

  7. To turn on ELMAH, navigate to Administration » Settings » Advanced » System » UI Elmah Config.
  8. Select the IsElmahLoggingTurnedOn checkbox and click Save changes.
    Every time you change the selection of this checkbox, you must restart the application.

    NOTE: When the ELMAH logging is turned off, the standard logging is working and you can see all the logging information in App_Data/Sitefinity/LogsWhen you select the IsElmahLoggingTurnedOn checkbox, all logging information is transferred to ELMAH.

Want to learn more?

Sign up for our free beginner training. Boost your credentials through advanced courses and certification.
Register for Sitefinity training and certification.

Was this article helpful?