# Test error logging with ELMAH

To ensure that you have configured error logging with ELMAH successfully, perform the following:

1. Open your Sitefinity CMS project in Visual Studio.
2. In the context menu of the *Solution Explorer*, click to *Add new* » *Web Form*.
3. Name the new web form `ELMAH`.
4. To throw new application exception, open the code-behind on the web form and add the following code in the `Page_Load`:

   ```C#
   using System;

   namespace SitefinityWebApp
   {
       public partial class TestException : System.Web.UI.UserControl
       {
           protected void Page_Load(object sender, EventArgs e)
           {
               throw new System.ApplicationException();
           }
       }
   }
   ```
5. Build the application, run it in the browser, and navigate to *<http://www.yoursite.com/elmah.axd>*.\
   You are prompted to log in before you see the content. After a successful authentication, you see a web page to remotely view the entire log of recorded exceptions.

   > info **NOTE**: Only administrators can see the page, other roles and unauthenticated users will get a 403 error.
6. To throw a new exception, navigate to *<http://www.yoursite.com/ELMAH.aspx>*.\
   The following error appears:

   ![](https://www.progress.com/documentation/sitefinity-cms/assets/52efef77cb2eefab76b32bb162e85227/elmah15fcc3abe5a66.png "elmah1")

   Once you get the exception, you must receive a new email in smtp4dev.\
   The email contains detailed information about the origin of the exception and the stack trace.
7. To view the full details of a logged exception, navigate one more time to **<http://www.yoursite.com/elmah.axd>**.\
   The following error log appears. It has default and detailed views.

   **Default view**

   ![](https://www.progress.com/documentation/sitefinity-cms/assets/f0a74d970cfe58479b51a2311c935cd4/elmah2.png "elmah2")

   **Detailed view**

   ![](https://www.progress.com/documentation/sitefinity-cms/assets/3c752c3e86754bc5ba3cf14f77462f0c/elmah3.png "elmah3")

Every exception in Sitefinity CMS is tracked and logged by ELMAH.\
For more information, see [ELMAH - Error Logging Modules And Handlers](https://docs.microsoft.com/en-us/aspnet/web-forms/overview/older-versions-getting-started/deploying-web-site-projects/logging-error-details-with-elmah-cs).
