Bewerken

Delen via


WebPageTraceListener.TraceEvent Method

Definition

Writes an event message to a Web page or to the ASP.NET trace viewer.

Overloads

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

Writes an event message to a Web page or to the ASP.NET trace viewer using the specified system and event data.

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

Writes a localized event message to a Web page or to the ASP.NET trace viewer using the specified system and event data.

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

Writes an event message to a Web page or to the ASP.NET trace viewer using the specified system and event data.

public:
 override void TraceEvent(System::Diagnostics::TraceEventCache ^ eventCache, System::String ^ source, System::Diagnostics::TraceEventType severity, int id, System::String ^ message);
public override void TraceEvent (System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType severity, 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, severity As TraceEventType, id As Integer, message As String)

Parameters

eventCache
TraceEventCache

A TraceEventCache that contains the current process and thread IDs and stack trace information.

source
String

A category name used to organize the output.

severity
TraceEventType

One of the TraceEventType values.

id
Int32

A numeric identifier for the event.

message
String

A message to write.

Remarks

The TraceEvent method writes the event message to the TraceContext object using source as the category and message as the message.

See also

Applies to

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

Writes a localized event message to a Web page or to the ASP.NET trace viewer using the specified system and event data.

public:
 override void TraceEvent(System::Diagnostics::TraceEventCache ^ eventCache, System::String ^ source, System::Diagnostics::TraceEventType severity, int id, System::String ^ format, ... cli::array <System::Object ^> ^ args);
public override void TraceEvent (System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType severity, 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, severity As TraceEventType, id As Integer, format As String, ParamArray args As Object())

Parameters

eventCache
TraceEventCache

A TraceEventCache that contains the current process and thread IDs and stack trace information.

source
String

A category name used to organize the output.

severity
TraceEventType

One of the TraceEventType values.

id
Int32

A numeric identifier for the event.

format
String

A format string that contains zero or more format items, which correspond to objects in args.

args
Object[]

An array of zero or more objects to format.

Remarks

The TraceEvent method calls the Format(IFormatProvider, String, Object[]) method, passing format and args and using the InvariantCulture property to format the string as the message to write to the trace viewer or Web page.

See also

Applies to