This post disappeared from a previous blog of mine so I'm reposting it.

Earlier this year Microsoft released the Enterprise Library v1.0.  The Enterprise Library consists of several Application Blocks that can be used to provide software infrastructure for enterprise application development.  According to the Enterprise Library documentation, the “Application blocks are reusable software components designed to assist developers with common enterprise development challenges.”  One of these Application Blocks, the Logging and Instrumentation Application Block, is the part of the focus of this article.


The purpose of this article is to explain how to set up the Logging and Instrumentation Application Block for BizTalk Server 2004 and BizTalk Server 2004 applications and to examine a simple sample application show its usage in a BizTalk Server 2004 application.  Detailed discussion on when and how to log are not covered in this article.

Why Logging is Important in BizTalk Server 2004 Applications

Although BizTalk Server 2004 supports tracking and the viewing of tracking data in HAT there are very good reasons for using ‘traditional’ logging and methods in BizTalk Server 2004 applications:

·         BizTalk Server 2004 tracking has a performance degradation cost associated with it; in some cases the performance degradation cost can be substantial.

·         You can gain explicit control as to when logging messages are sent using logging filters.

·         You can gain explicit control as to how the logging messages are sent (Event Log, database, file, email, etc.)

·         You can categorize logging messages (debug, exception, trace, etc.)

·         You gain control of the format of the logging messages.

·         You can create your own events/notifications that could be subscribed to with other software components.

·         If you do not have access to HAT in your production environment you can still get valuable data ‘sent’ to your development team.