This enumeration is used by trace listeners to determine which options, or elements, should be included in the trace output. Trace listeners store the trace options in the TraceListener.TraceOutputOptions property.
The following example shows the use of the traceOutputOptions attribute to specify the trace output options for a System.Diagnostics.ConsoleTraceListener that is enabled using a configuration file.
Example
<configuration> <system.diagnostics> <trace autoflush="false" indentsize="4"> <listeners> <add name="consoleListener" type="System.Diagnostics.ConsoleTraceListener"
For details about adding trace listeners to the application configuration file, see <listeners> Element.
The System.Diagnostics.TraceOptions enumeration is not used by the following classes and methods:
The System.Diagnostics.EventLogTraceListener class, because it can cause a large volume of data to be written to the log.
The Write and WriteLine methods of the System.Diagnostics.ConsoleTraceListener, System.Diagnostics.DefaultTraceListener, and System.Diagnostics.TextWriterTraceListener classes.
The erload:System.Diagnostics.TraceListener.Write and erload:System.Diagnostics.TraceListener.WriteLine methods of the System.Diagnostics.TraceListener class when they are not overridden in a derived class.
Member Name | Description |
---|---|
Callstack |
Write the call stack, which is represented by the return value of the Environment.StackTrace property. |
DateTime |
Write the date and time. |
LogicalOperationStack |
Write the logical operation stack, which is represented by the return value of the CorrelationManager.LogicalOperationStack property. |
None |
Do not write any elements. |
ProcessId |
Write the process identity, which is represented by the return value of the Process.Id property. |
ThreadId |
Write the thread identity, which is represented by the return value of the System.Threading.Thread.ManagedThreadId property for the current thread. |
Timestamp |
Write the timestamp, which is represented by the return value of the Stopwatch.GetTimestamp method. |