简体   繁体   English

将 IIS http 请求记录到数据库中

[英]Log IIS http requests into database

I have IIS server used to integrate with external entities, and I need to log the request body into db.我有 IIS 服务器用于与外部实体集成,我需要将请求正文记录到数据库中。 I don't want to use IIS out of the box logging as it it will log in file and i need to save it in db in specific schema.我不想使用 IIS 开箱即用的日志记录,因为它会登录文件,我需要将其保存在特定模式的数据库中。

you can use Serilog and use your particular database sink您可以使用 Serilog 并使用您的特定数据库接收器

 app.UseSerilogRequestLogging();

ODBC logging format is a record of a fixed set of data properties in a database that complies with Open Database Connectivity (ODBC), such as Microsoft Access or Microsoft SQL Server?. ODBC 日志记录格式是符合开放式数据库连接 (ODBC) 的数据库中一组固定数据属性的记录,例如 Microsoft Access 或 Microsoft SQL Server?。 Some of the items logged include the user's IP address, user name, request date and time (recorded as local time), HTTP status code, bytes received, bytes sent, action carried out (for example, a download carried out by a GET command), and the target (for example, the file that was downloaded).记录的一些项目包括用户的 IP 地址、用户名、请求日期和时间(记录为本地时间)、HTTP 状态代码、接收的字节数、发送的字节数、执行的操作(例如,通过 GET 命令执行的下载) 和目标(例如,下载的文件)。 With ODBC logging, you must both specify the database to be logged to, and set up the database to receive the data.使用 ODBC 日志记录,您必须指定要记录到的数据库,并设置数据库以接收数据。 Maybe this blog will help you.也许这个博客会对你有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM