asp.net| Access asp.net 2.0 allows you to access the trace information for each request through code in the TraceFinished event. The TraceFinished event is raised by the TraceContext object, which is used to expose trace messages after all request information has been collected. You can use this event to make different output of the trace information. The following code is the output trace information with the program.
<%@ Page language= "VB"%>
<script runat= "Server" >
Protected Sub Page_Load (ByVal sender as Object, ByVal e as System.EventArgs)
AddHandler trace.tracefinished, AddressOf ontracefinished
Trace.Write ("Custom category", "Custom Trace Message")
End Sub
Private Sub ontracefinished (ByVal sender as Object, ByVal e as Tracecontexteventargs)
Dim TCR as Tracecontextrecord
For each TCR in E.tracerecords
Response.Write (String.Format ("<li> trace Category: {0} trace message: {1}", TCR.) Category, TCR. Message))
Next
End Sub
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.