Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 4
System.Diagnostics
TraceListener Class
TraceEvent Method
 TraceEvent Method (TraceEventCache,...
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2010/.NET Framework 4

Other versions are also available for the following:
.NET Framework Class Library
TraceListener..::.TraceEvent Method (TraceEventCache, String, TraceEventType, Int32, String)

Writes trace information, a message, and event information to the listener specific output.

Namespace:  System.Diagnostics
Assembly:  System (in System.dll)
Visual Basic
<ComVisibleAttribute(False)> _
Public Overridable Sub TraceEvent ( _
    eventCache As TraceEventCache, _
    source As String, _
    eventType As TraceEventType, _
    id As Integer, _
    message As String _
)
C#
[ComVisibleAttribute(false)]
public virtual void TraceEvent(
    TraceEventCache eventCache,
    string source,
    TraceEventType eventType,
    int id,
    string message
)
Visual C++
[ComVisibleAttribute(false)]
public:
virtual void TraceEvent(
    TraceEventCache^ eventCache, 
    String^ source, 
    TraceEventType eventType, 
    int id, 
    String^ message
)
F#
[<ComVisibleAttribute(false)>]
abstract TraceEvent : 
        eventCache:TraceEventCache * 
        source:string * 
        eventType:TraceEventType * 
        id:int * 
        message:string -> unit 
[<ComVisibleAttribute(false)>]
override TraceEvent : 
        eventCache:TraceEventCache * 
        source:string * 
        eventType:TraceEventType * 
        id:int * 
        message:string -> unit 

Parameters

eventCache
Type: System.Diagnostics..::.TraceEventCache
A TraceEventCache object that contains the current process ID, thread ID, and stack trace information.
source
Type: System..::.String
A name used to identify the output, typically the name of the application that generated the trace event.
eventType
Type: System.Diagnostics..::.TraceEventType
One of the TraceEventType values specifying the type of event that has caused the trace.
id
Type: System..::.Int32
A numeric identifier for the event.
message
Type: System..::.String
A message to write.
Important noteImportant

This method is not intended to be called directly by application code but by members of the Debug, Trace, and TraceSource classes to write trace data to output.

The default implementation writes the values of the source, eventType and id parameters as a header, followed by the message data. The eventCache data is written as a footer, the nature of the output data being dependent on the value of the TraceOutputOptions property.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker