System.Diagnostics.TraceListener.TraceEvent Method

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

Syntax

[System.Runtime.InteropServices.ComVisible(false)]
public virtual void TraceEvent (TraceEventCache eventCache, string source, TraceEventType eventType, int id, string message)

Parameters

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

Remarks

Note:

This method is not intended to be called directly by application code but by members of the System.Diagnostics.Debug, System.Diagnostics.Trace, and System.Diagnostics.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 TraceListener.TraceOutputOptions property.

Requirements

Namespace: System.Diagnostics
Assembly: System (in System.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0