Appendix A. The COM+ Logbook

One of the most effective steps you can take towards achieving a more robust application that is faster to market is adding a logging capability to your application. This appendix presents you with the COM+ Logbook, a simple utility you can implement to log method calls, events, errors, and various COM+ information. The logbook is your product’s flight recorder. In a distributed COM+ environment, it is worth its weight in gold. It saved my skin whenever I tried to analyze why something did not work the way it was supposed to. By examining the log files, you can analyze what took place across machines and applications, and the source of the problem is almost immediately evident. The logbook is also useful in post-deployment scenarios to troubleshoot customer problems—just have your customer send you the log files.

Logbook Requirements

The goals for this logbook are as follows:

  • Trace the calling tree (the causality) from the original client down to the lowest components, across threads, processes, and machines—tracing the logical thread of execution.

  • Log the call’s/event’s/error’s time and location.

  • Interleave all the calls from all applications into one log file.

  • Log the current COM+ execution context.

  • Allow administrative customization to determine what is logged—for example, just errors, or events and errors.

  • Allow administrative customization of the log filename.

  • Make logging and tracing as easy as possible.

  • Save log data in two formats: HTML or XML.

  • Have ...

Get COM & .NET Component Services now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.