WebPageTraceListener.TraceEvent Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Writes an event message to a Web page or to the ASP.NET trace viewer.
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. |
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
.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 |
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
.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 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: