To build successful and flexible applications that can be maintained and supported easily, you must adopt an appropriate strategy for exception management. You must design your system to ensure that it is capable of the following:
- Detecting exceptions.
- Logging and reporting information.
- Generating events that can be monitored externally to assist system operation.
Spending the time at the beginning to design a clear and consistent exception management system frees you from having to piece one together during development, or worse still, from having to retrofit exception handling back into an existing code base.
An exception management system should be well encapsulated and should abstract the details of logging and reporting from the application's business logic. It should also be capable of generating metrics that can be monitored by operators to provide an insight into the current health and status of the application. This helps to create an application that can quickly and accurately notify operators of any problems it is experiencing, and can provide valuable information to assist developers and support services with problem resolution.
Exception Management in AxCMS.net
As base for the Exception Management the Axinom Enterprise CMS uses the Exception Management Application Block by Microsoft. Further details at Microsoft Developer Network (msdn.microsoft.com).
Should an exception occur and not be intercepted, the user receives a general error page (error.htm) and the exception information is documented (“published”).
Configuration of the Exception-Management:
Several ExceptionPublishers are available to you, in addition you can develop (have them developed) your own ExceptionPublishers. Standard setting is ExceptionPublisherFile.
||Only the last Exception will be stored.
Note: Write access for the ASPNET-User for the mentioned file.
||An E-Mail will be sent per exception to an operator.
Parameter: Operator, Subject, From
Note: SmtpServer has to be set up correctly at AppSettings
||Parameter: logName, applicationName
Note: Write access for EventLog. Are usually assigned by CMS-Installer. If not, you can do it manually with installutil.exe. You will find an example in the CMS at installation\ConfigureExceptionPublisher.bat.
||Any required method to transfer
exceptions to the developers
I.e. save in a data base.
||Obsolete, not any longer supported.
With on/off the respective ExceptionPublisher can be switched on and off.
If a Messaging System like Microsoft Exchange is used, we recommend the ExceptionPublisherMail and a Public Folder as address for the exceptions.
If the exceptions file was not stored:
Make sure that the ASPNET-User has write access for the mentioned file.
According to the web.config settings only the last Exception might be stored, to avoid that add overwrite="false"
If the exception mail was not sent:
Make sure that the SmtpServer has set up correctly at AppSettings
If your application throws a security exception, then something in your exception management is not configured well. AxCMS.net then tries to write exception in Event Log. To be able to do this, it must be allowed. Please run following command in commandline to allow writing in EventLog:
Please have a look in our forum too...
Use exception management in your AxCMS.net related application (importer, create application)
To be able to use our mail sending exception management you have to init smtp server in your application:
System.Web.Mail.SmtpMail.SmtpServer = CMSConfigurationSettings.SmtpServer;