O'Reilly logo

.NET Patterns: Architecture, Design, and Process by Christian Thilmany

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Technology Backgrounder—Trace Switches and Trace Listeners

Trace Listeners

Trace listeners are thread-safe classes that derive from an abstract class called, appropriately enough, System.Diagnostics.TraceListener. This class contains the necessary methods to be able to control trace output. There are three out-of-the-box trace listeners included with .NET. The first is called DefaultTraceListener and, by default, is automatically added to a trace listener collection shared by the application. Using the Trace.Listeners static property, you can access this collection at any time during execution. Using the collection, you can then add or remove any trace listener. Controlling the listeners in the collection will, therefore, control your trace output. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required