Understanding Trace Listeners

In the preceding examples related to the Debug class (and consequently related to the Trace class too), we saw how to send the output of the debugger to the Output window. The .NET Framework enables sending the output to other targets, known as trace listeners. A trace listener is basically an object that “listens” to what is happening at debugging time and then collects information under various forms. For example, you could collect information as XML files or just send such information to the Output window. Both Debug and Trace classes expose a property named Listeners that represents a set of built-in listeners. Table 5.3 groups the .NET Framework built-in listeners.

Table 5.3 .NET Built-In Trace Listeners

Get Visual Basic® 2010 Unleashed 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.