1
我的经典ASP网站上有一段简单的代码,当页面发生错误时向我发送电子邮件,因为我在web.config中设置了一个指向页面来处理错误的代码:寻找ASP的原因错误
<httpErrors errorMode="Custom" defaultResponseMode="ExecuteURL">
<remove statusCode="500" subStatusCode="100" />
<remove statusCode="500" subStatusCode="-1" />
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" path="/error_404.asp" responseMode="ExecuteURL" />
<error statusCode="500" prefixLanguageFilePath="" path="/error_500.asp" responseMode="ExecuteURL" />
<error statusCode="500" subStatusCode="100" path="/error_500.asp" responseMode="ExecuteURL" />
</httpErrors>
这是我的代码简单位:
...
set objError = Server.getLastError()
strNumber = objError.AspCode
strSource = objError.Category
strDesc = newstr(objError.Description)
strCode = newstr(objError.Source)
strLine = ObjError.Line
strASPDesc = ObjError.ASPDescription
strRemoteAddr = Request.ServerVariables("REMOTE_ADDR")
ref = request.servervariables("HTTP_REFERER")
str = request.servervariables("QUERY_STRING")
cookies = request.servervariables("HTTP_COOKIE")
ip_url = strRemoteAddr
ua = newstr(request.servervariables("HTTP_USER_AGENT"))
totalstring = objError.File & "?" & str
我然后串联这些值加在一起,并通过电子邮件的细节我自己。
对于一个错误,我会得到这样的事情:
strNumber: ASP 0126
strSource: Active Server Pages
strDesc: Include file not found
strCode:
strLine: 14
strASPDesc: The include file '/news/aw.asp' was not found.
strRemoteAddr: 2.101.166.175
ref: http://example.com/sites/support/
str: page=cd
cookies: usr1=62105233D8E2A062A55; fantastic%5Fcheese=1; _ga=GA1.3.1357551757.1476543431; __atuvc=2%7C41%2C1%7C42%2C0%7C43%2C0%7C44%2C9%7C45; __utma=154830755.1357551757.1476543431.1476822981.1479368067.3; __utmz=154830755.1476818175.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); ASPSESSIONIDQCBABQAR=KHGBAMBCCCENHCIPPCOFBJOO; __utmb=154830755.1.10.1479368067; __utmc=154830755; __utmt=1
ip_url: 84.92.46.118
ua: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0
totalstring: /sites/support/page.asp?landscape=cd
但是,我往往只看到这个错误:
strNumber:
strSource:
strDesc:
strCode:
strLine: 0
strASPDesc:
strRemoteAddr: 43.247.156.6
ref: http:/example.com/content/this.asp
str: 500;http://jimpix.co.uk:80/words/check-username.asp
cookies: ASPSESSIONIDSAABARBQ=ACDDOHOCEKIEFOCKFBFIHJBC; _gat=1; __atuvc=129%7C46; __atuvs=582e898682f62926059; _ga=GA1.3.491207786.1479439414
ip_url: 43.247.156.6
ua: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36
totalstring: ?500;http:/example.com:80/content/this.asp
有没有错误的详细信息本身,而是它总是在同一页上。我无法弄清楚是什么原因造成的。
是否有更详细的错误日志记录我可以做更多的发现?直到响应缓冲区已经开始冲洗内容到客户端