TraceContext Class
TOC
Collapse the table of content
Expand the table of content

TraceContext Class

 

Captures and presents execution details about a Web request. This class cannot be inherited.

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

System::Object
  System.Web::TraceContext

public ref class TraceContext sealed 

NameDescription
System_CAPS_pubmethodTraceContext(HttpContext^)

This API supports the product infrastructure and is not intended to be used directly from your code. Initializes a new instance of the TraceContext class.

NameDescription
System_CAPS_pubpropertyIsEnabled

Gets or sets a value indicating whether tracing is enabled for the current Web request.

System_CAPS_pubpropertyTraceMode

Gets or sets the sorted order in which trace messages should be output to a requesting browser.

NameDescription
System_CAPS_pubmethodEquals(Object^)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

System_CAPS_pubmethodWarn(String^)

Writes a trace message to the trace log. All warnings appear in the log as red text.

System_CAPS_pubmethodWarn(String^, String^)

Writes trace information to the trace log, including any user-defined categories and trace messages. All warnings appear in the log as red text.

System_CAPS_pubmethodWarn(String^, String^, Exception^)

Writes trace information to the trace log, including any user-defined categories, trace messages, and error information. All warnings appear in the log as red text.

System_CAPS_pubmethodWrite(String^)

Writes a trace message to the trace log.

System_CAPS_pubmethodWrite(String^, String^)

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

System_CAPS_pubmethodWrite(String^, String^, Exception^)

Writes trace information to the trace log, including any user-defined categories, trace messages, and error information.

NameDescription
System_CAPS_pubeventTraceFinished

Raised by the TraceContext object to expose trace messages after all request information is gathered.

You can use this class to append messages to specific trace categories. For example, if you are creating an instance of the Calendar class for your application, you might include the trace message "Starting To Render" in a rendering procedure, and "Raising OnChange Event" in an event handler procedure.

You can also use the TraceContext class to obtain a set of trace records at the end of request execution for custom processing. For more information, see ASP.NET Tracing Overview.

To enable tracing, set the Trace attribute in the @ Page directive or the IsEnabled property to true. When tracing is enabled, in addition to showing user-provided trace content, the Page class automatically includes performance data, control-tree structure information, and state management content for every request.

.NET Framework
Available since 1.1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft