将所有接收的数据(头,IP等)记录到每个aspx页面请求的db [英] Log all received data (headers, IP, etc.) to db for each aspx page request

查看:196
本文介绍了将所有接收的数据(头,IP等)记录到每个aspx页面请求的db的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在构建asp.net应用程序,其中我们要将收到的数据(IP,http头文件等)记录到每个页面请求的数据库中。

We are building asp.net application in which we want to log the received data (IP, http headers, etc) to database for every page request.

如何组织aps.net应用程序,以便我们能够将日志记录到数据库,即使出现异常?

这是一个好的主意?

我们应该在新线程中将数据写入数据库,这样不会减慢响应?

How to organize aps.net application, so that we are able to make a log to db even in case of exception?
Is this a good idea?
Should we write data to db in a new thread, so that it doesn't slow down the response?

推荐答案

如果您使用的是IIS7,请查看请求跟踪失败。您可以设置规则,以便在给定某些错误条件时记录有关请求的各种详细信息。 XML文件包含有关处理请求的所有HttpModules和HttpHandler的请求信息,头文件和详细信息。

If you are using IIS7, take a look at Failed Request Tracing. You can set up rules that will log all sorts of details about the request given certain error conditions. The XML file contains the request information, headers, and details about all of the HttpModules and HttpHandlers that processed the request.

这篇关于将所有接收的数据(头,IP等)记录到每个aspx页面请求的db的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆