Bewerken

Delen via


DelimitedListTraceListener.TraceEvent Method

Definition

Writes event trace information to an output file or stream.

Overloads

TraceEvent(TraceEventCache, String, TraceEventType, Int32, String)

Writes trace information, a message, and event information to the output file or stream.

TraceEvent(TraceEventCache, String, TraceEventType, Int32, String, Object[])

Writes trace information, a formatted array of objects, and event information to the output file or stream.

TraceEvent(TraceEventCache, String, TraceEventType, Int32, String)

Source:
DelimitedListTraceListener.cs
Source:
DelimitedListTraceListener.cs
Source:
DelimitedListTraceListener.cs

Writes trace information, a message, and event information to the output file or stream.

public:
 override void TraceEvent(System::Diagnostics::TraceEventCache ^ eventCache, System::String ^ source, System::Diagnostics::TraceEventType eventType, int id, System::String ^ message);
public override void TraceEvent (System.Diagnostics.TraceEventCache? eventCache, string source, System.Diagnostics.TraceEventType eventType, int id, string? message);
public override void TraceEvent (System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType eventType, int id, string message);
override this.TraceEvent : System.Diagnostics.TraceEventCache * string * System.Diagnostics.TraceEventType * int * string -> unit
Public Overrides Sub TraceEvent (eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, message As String)

Parameters

eventCache
TraceEventCache

A TraceEventCache object that contains the current process ID, thread ID, and stack trace information.

source
String

A name used to identify the output, typically the name of the application that generated the trace event.

eventType
TraceEventType

One of the TraceEventType values specifying the type of event that has caused the trace.

id
Int32

A numeric identifier for the event.

message
String

The trace message to write to the output file or stream.

Remarks

The values of the source, eventType, and id parameters are written as a header, followed by the message data. The eventCache data is written as a footer whose content depends on the value of the TraceOutputOptions property.

Important

The TraceEvent method is not intended to be called by application code. It is called by methods of the Debug, Trace, and TraceSource classes to write trace data.

Applies to

TraceEvent(TraceEventCache, String, TraceEventType, Int32, String, Object[])

Source:
DelimitedListTraceListener.cs
Source:
DelimitedListTraceListener.cs
Source:
DelimitedListTraceListener.cs

Writes trace information, a formatted array of objects, and event information to the output file or stream.

public:
 override void TraceEvent(System::Diagnostics::TraceEventCache ^ eventCache, System::String ^ source, System::Diagnostics::TraceEventType eventType, int id, System::String ^ format, ... cli::array <System::Object ^> ^ args);
public override void TraceEvent (System.Diagnostics.TraceEventCache? eventCache, string source, System.Diagnostics.TraceEventType eventType, int id, string format, params object?[]? args);
public override void TraceEvent (System.Diagnostics.TraceEventCache? eventCache, string source, System.Diagnostics.TraceEventType eventType, int id, string? format, params object?[]? args);
public override void TraceEvent (System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType eventType, int id, string format, params object[] args);
override this.TraceEvent : System.Diagnostics.TraceEventCache * string * System.Diagnostics.TraceEventType * int * string * obj[] -> unit
Public Overrides Sub TraceEvent (eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, format As String, ParamArray args As Object())

Parameters

eventCache
TraceEventCache

A TraceEventCache object that contains the current process ID, thread ID, and stack trace information.

source
String

A name used to identify the output, typically the name of the application that generated the trace event.

eventType
TraceEventType

One of the TraceEventType values specifying the type of event that has caused the trace.

id
Int32

A numeric identifier for the event.

format
String

A format string that contains zero or more format items that correspond to objects in the args array.

args
Object[]

An array containing zero or more objects to format.

Remarks

The values of the source, eventType, and id parameters are written as a header. The args object array is converted to a string using the String.Format(String, Object[]) method, passing the format string and args array to format the string as the message portion of the trace. The eventCache data is written as a footer whose content depends on the value of the TraceOutputOptions property.

Important

The TraceEvent method is not intended to be called by application code. It is called by methods of the Debug, Trace, and TraceSource classes to write trace data.

Applies to