Exception mailer usage and configuration


Register configuration section

Include the following section registration in your web.config file:
    <sectionGroup name="altairis.web">
        <section name="management" type="Altairis.Web.Management.Configuration.ManagementSection, Altairis.Web.Management"/>

Register HTTP module

Register the ErrorHandlingModule HTTP module (used also by error page handling, so register it only once):
        <add name="ErrorHandlingModule" type="Altairis.Web.Management.ErrorHandlingModule, Altairis.Web.Management" />

Configure general mailing options

Altairis Web Management Toolkit honors application-wide mailing settings in the system.net/mailSettings/smtp section. The following is sample configuration (use both specifiedPickupDirectory and network elements, even when pickup is used to prevent the The SMTP host was not specified. error).
        <smtp deliveryMethod="SpecifiedPickupDirectory">
            <specifiedPickupDirectory pickupDirectoryLocation="C:\InetPub\MailRoot\pickup"/>
            <network host="localhost"/>

Configure the exception mailing

This is minimal configuration to get the exception mailing up and running - enable it and specify sender and receiver e-mail addresses:
        <exceptionMailer enabled="true" mailSenderAddress="sender@domain" mailRecipientAddress="recipient@domain" />
Possible attributes of the exceptionMailer element:
Name Default value Description
enabled false Set to true to enable exception mailer.
excludeLocalRequests true Ignore requests coming from the same computer (useful for development).
excludeSystemUrls true Ignore requests to system URLs, like WebResource.axd and so on.
mailRecipientAddress mandatory E-mail address of recipient of error e-mail messages.
mailSenderName hostname Display name of originator of error e-mail messages.
mailSenderAddress mandatory E-mail address of originator of error e-mail messages.
maximumSubjectLength 50 Maximum length of subject string (derived from error message), 10-200 characters.

Ignored exceptions

The mailer ignores the following exception types, since they usually do not represent real error in application:
  • HttpRequestValidationException - "A potentially dangerous value was detected from the client..."
  • ViewStateException - invalid viewstate
  • HttpException - HTTP error, such as 404 on .aspx file

Last edited Jul 4, 2011 at 12:35 AM by altair, version 2


No comments yet.