TraceContextRecord Class
Assembly: System.Web (in system.web.dll)
The TraceContextRecord object encapsulates the trace message, category, any associated Exception, and whether the trace record was written by the System.Web.TraceContext.Warn method.
Every call to the System.Web.TraceContext.Write and System.Web.TraceContext.Warn methods generates a TraceContextRecord object that is added to the TraceContextEventArgs.TraceRecords messages collection. You can access the collection of records by handling the TraceFinished event.
The following code example demonstrates how you can register a TraceContextEventHandler delegate to handle the TraceFinished event. In this example, the OnTraceFinished method accesses the collection of TraceContextRecord objects through the TraceRecords property, iterates through them, and writes them to the response stream.
- SecurityPermission for operating in a hosted environment. Demand value: LinkDemand; Permission value: Minimal.