Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
DelimitedListTraceListener Class

Directs tracing or debugging output to a text writer, such as a stream writer, or to a stream, such as a file stream.

Namespace:  System.Diagnostics
Assembly:  System (in System.dll)
Visual Basic (Declaration)
<HostProtectionAttribute(SecurityAction.LinkDemand, Synchronization := True)> _
Public Class DelimitedListTraceListener _
    Inherits TextWriterTraceListener
Visual Basic (Usage)
Dim instance As DelimitedListTraceListener
C#
[HostProtectionAttribute(SecurityAction.LinkDemand, Synchronization = true)]
public class DelimitedListTraceListener : TextWriterTraceListener
Visual C++
[HostProtectionAttribute(SecurityAction::LinkDemand, Synchronization = true)]
public ref class DelimitedListTraceListener : public TextWriterTraceListener
JScript
public class DelimitedListTraceListener extends TextWriterTraceListener
NoteNote:

The HostProtectionAttribute attribute applied to this type or member has the following Resources property value: Synchronization. The HostProtectionAttribute does not affect desktop applications (which are typically started by double-clicking an icon, typing a command, or entering a URL in a browser). For more information, see the HostProtectionAttribute class or SQL Server Programming and Host Protection Attributes.

The trace output is in a delimited text format that uses the delimiter specified by the Delimiter property.

You can enable or disable a DelimitedListTraceListener through the application configuration file and then use the configured DelimitedListTraceListener in your application. Alternately, you can create a DelimitedListTraceListener in your code.

To configure a DelimitedListTraceListener, edit the configuration file that corresponds to the name of your application. In this file, you can add a listener, set the properties for a listener, or remove a listener. The configuration file should be formatted like the following example:

<configuration>
  <system.diagnostics>
    <trace autoflush="false" indentsize="4">
      <listeners>
        <add name="delimitedListener" 
          type="System.Diagnostics.DelimitedListTraceListener" 
          delimiter=":" 
          initializeData="delimitedOutput.txt" 
          traceOutputOptions="ProcessId, DateTime" />
        <remove name="Default" />
      </listeners>
    </trace>
  </system.diagnostics>
</configuration>
NoteNote:

If an attempt is made to write to a file that is in use or unavailable, the file name is automatically prefixed by a GUID.

NoteNote:

Listeners are intended to be used by methods of the Debug, Trace, and TraceSource classes to write trace information. Listener methods, other than constructors, are not intended to be called directly from application code.

System..::.Object
  System..::.MarshalByRefObject
    System.Diagnostics..::.TraceListener
      System.Diagnostics..::.TextWriterTraceListener
        System.Diagnostics..::.DelimitedListTraceListener
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker