The default behavior of the Exception Manager is to publish exceptions to the Windows Event Log, however, Aptify also provides the ability to write the log exceptions to a file within the Aptify database. In addition, Aptify also includes publishers that can write to a database or send an SMTP message and it is possible to create new publishers as a plug-in. Aptify has the ability to enable a database publisher. Enabling the database publisher sends exceptions logged in the database to the Error Log entity, and saved as Error Log records so that the Aptify viewing system and entity form template functionality can be used to find and view these exceptions.
When only the database publisher is enabled in Aptify, exceptions are no longer sent to the Windows Event Log. It is possible to enable both publishers so that exceptions are sent to the Windows Event Log and to Error Log records. |
The steps below illustrate how to configure Aptify so that exceptions are logged to a common file.
Uncomment the publisher mode attribute from within the exceptionManagement section by removing the <!-- from before and the --> from the end. The line is below:
<publisher mode="on" days="3" exceptionformat="xml" directory="c:\" assembly="AptifyExceptionManagement" type="Aptify.Framework.ExceptionManagement.XMLFilePublisher"/> |
If the line does not exist, add it between the exceptionManagement tags.
When no publishers are defined in the exceptionManagement section, the default publisher is used. The default publisher is the Event Log publisher.
Configure the settings to fit your organization’s needs.
assembly: The assembly for this publisher. The default value is AptifyException. However, a developer can create a plug-in based on an organization’s needs.
type: The publisher type. The default value is Aptify.Framework.ExceptionManagement.XMLFilePublisher. Aptify adds support for a database publisher that sends database exceptions to a new entity, Error Log. The type for the database publisher is Aptify.Framework.ExceptionManagement.DatabasePublisher.
For example, to enable the database publisher, you would enter something similar to the following:
<exceptionManagement mode="on" defaultseverity="0" legacytextformat="true"> <publisher mode="on" assembly="AptifyExceptionManagement" type="Aptify.Framework.ExceptionManagement.DatabasePublisher"/> </exceptionManagement> |
In this example, both the default Error Log publisher and the database publisher are enabled:
<exceptionManagement mode="on" defaultseverity="0"> <publisher mode="on" assembly="AptifyExceptionManagement" type="Aptify.Framework.ExceptionManagement.DatabasePublisher"/> <publisher mode="on" assembly="AptifyExceptionManagement" type="Aptify.Framework.ExceptionManagement.EventLogPublisher"/> </exceptionManagement> |
When the database publisher is enabled, all exceptions are logged to Error Log records (unless you have it configured to log to both Aptify and the Windows Event Log). This can result in a large number of records which you may find you want to archive or delete overtime. There is not currently an archive run type to support archiving. This is a feature we are considering for future releases. Please contact Aptify if you are interested in this feature. See Archiving Transactional Data for more information. Aptify adds a stored procedure database object, spDeleteERRORLOGRecordBefore, to the Error Log entity to enable the deletion of all Error Log records created before a date specified in a parameter, @BeforeDate. |