Logging Web service and Browser exceptions

Build 1501 on 14/Nov/2017  This topic last edited on: 21/Mar/2016, at 18:52

There's a HTTP module that tracks exceptions in Web service (Web application) . The log is saved as a series of XML files in the App_Data folder of the Web application (typically C:\tera\GN4\Web\GNPortal\App_Data)

The folder contains all exceptions generated by the server for any client: Browser, Ted, Fred.

There's a Web interface to review exceptions (example: http://localhost/gn4/elmah.axd):

Click to toggle graphic size

For every exception you can review the host, the exception type, the HTTP response code, the user, date and time, and all details such as stack trace and server variables:

Click to toggle graphic size

By default, you can review the exceptions only on the Web application host (server). If you want to change such behavior, change path where the exceptions are saved in the Web.config file:

  <elmah>

    <security allowRemoteAccess="0" />

    <errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data" />

</elmah>

The list of exceptions is available also in the RSS format (http://localhost/gn4/elmah.axd/rss ) or you can download it as a .CSV file.

By adding the following parameter to the <elmah> section:

connectionStringName="..." />

...you can specify a SQL provider and write exceptions in a database. If you are interested to this possibility look at the script to create the tables/stored procedure. There are many provider available for Oracle, MySQL, and implementation is described here: http://code.google.com/p/elmah/wiki/ErrorLogImplementations

Click to toggle expandScript to create tables/stored procedure