Reputation: 3058
I am tracing my ASPX page by enabling tracing in web.config
(<trace enabled="true" pageOutput="true"/>
)
How could i save this information (specifically the request headers) into a log file.
Thanks for sharing your valuable time.
Upvotes: 3
Views: 8128
Reputation: 1669
foreach (string key in HttpContext.Current.Request.Headers)
{
YourLoggingMethod(key, HttpContext.Current.Request.Headers[key]);
}
Upvotes: -2
Reputation: 498914
Simply enabling tracing the way your have is not enough - you need to configure what to trace and what to do with the trace.
See Trace Listeners and Configuring Tracing on MSDN.
Upvotes: 6
Reputation: 9942
Check the below link which show various options of tracing
http://www.codeproject.com/Articles/82290/Step-by-Step-Guide-to-Trace-the-ASP-NET-Applicatio
Upvotes: 3