TraceContext::Write Method (String^, String^)
Writes trace information to the trace log, including a message and any user-defined categories.
Assembly: System.Web (in System.Web.dll)
Parameters
- category
-
Type:
System::String^
The trace category that receives the message.
- message
-
Type:
System::String^
The trace message to write to the log.
Every time the Write method is called, a TraceContext trace message is added to the TraceRecords messages collection, which is accessible when you handle the TraceFinished event. The message is added with its IsWarning property set to false and its ErrorInfo property set to null.
The following code example demonstrates how to call the Write method to write an error trace message to the trace log. In this example, the delegate iterates through the trace messages and writes them as an HTML table; however, you can write the same information to a database or a profiling tool consumer.
Available since 1.1