TraceContext.Write Method (String, String)

 

Writes trace information to the trace log, including a message and any user-defined categories.

Namespace:   System.Web
Assembly:  System.Web (in System.Web.dll)

member Write : 
        category:string *
        message:string -> unit

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.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: