【发布时间】:2013-03-01 10:29:37
【问题描述】:
我在生产系统中有一个问题错误,我根本找不到。有时系统会产生无效链接。当最终用户单击它时,我会从系统收到错误报告,最终用户会收到错误消息。失败的 URL 是这样的:
http://www.mysite.com/somepath/undefined/
“未定义”部分是问题,我认为这是由 JavaScript 产生的,但我想确保它不是来自后端。
如果文件包含字符串“/undefined/”,是否可以使用 global.asax 将每个响应保存到文件中?
我试过这个:
protected void Application_EndRequest(object sender, EventArgs e)
{
TextReader t = new StreamReader(Response.OutputStream);
string content = t.ReadToEnd();
// look for "/undefined/" and save to a temp file is the easy part after this
}
但是说OutputStream 是不可读的。
我不确定是哪个页面/ajax 请求产生了错误链接,所以我需要检查每个响应。
【问题讨论】:
标签: c# asp.net save global-asax outputstream