Dotfuscator User's Guide
Configuring Message Tracing

The developer can obtain a client side trace of outgoing messages by setting up message tracing in the application and examining the output as outlined below:

Here's a sample App.config File:
Copy Code
    <trace autoflush="true" indentsize="0">
        <remove name="Default"/>
        <add name="myListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="c:\myListener.log" />
      <add name="traceSwitch" value="4" />

The <listeners> element in the config file is where the developer can add and remove any or all listeners. Refer to the preceding example; it removes the default Trace Listener, which is DefaultTraceListener (the output window in Visual Studio), and adds the TextWriterTraceListener, which writes traces messages to c:\myListener.log.


This class provides support for multiple levels instead of the simple on/off control offered by the BooleanSwitch class. TraceSwitch class works with the following tracing levels:

Tracing Level Configuration Value Description
Off 0 Outputs no messages to Trace Listeners
Error 1 Outputs only error messages to Trace Listeners
Warning 2 Outputs error and warning messages to Trace Listeners
Info 3 Outputs informational, warning and error messages to Trace Listeners
Verbose 4 Outputs all messages to Trace Listeners

The name of the trace switch used in the message sending runtime is "traceSwitch", and the name of the config file trace switch name must be exactly the same for the tracing to work.



© 2016 PreEmptive Solutions, LLC. All Rights Reserved.