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.

C#
public override void TraceEvent (System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType severity, int id, string message);

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

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

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.

C#
public override void TraceEvent (System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType severity, int id, string format, params object[] args);

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

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1