大网数据广告活动
Web服务器与PHP

Configuring and Enabling Server Side Logging

· 52CE 我爱测

Configuring and Enabling Server Side Logging

The application enables logging on the server session or the URL group before sending the response with HttpSendHttpResponse. The following example shows how to configure and enable W3C type server side logging:

  1. The application initializes the HTTP_LOGGING_INFO structure with HttpLoggingTypeW3C specified in the Format member, and a bitmask of the HTTP_LOG_FIELD constants in the Fields member.
  2. The application calls HttpSetServerSessionProperty or HttpSetUrlGroupProperty with HttpServerLoggingProperty specified in the Property parameter and a pointer to the HTTP_LOGGING_INFO structure in the pPropertyInformation parameter.

The bitmask of the HTTP_LOG_FIELD constants contain the fields that may be logged in the W3C log file. Note that setting the HttpServerLoggingProperty property on a server session or a URL group does not mean that HTTP responses will be logged. Logging is performed on a per request basis when W3C is enabled in the call to HttpSendHttpResponse or HttpSendResponseEntityBody.

To enable W3C response logging on a per request basis, the application performs the following steps:

  1. The application initializes the members of the HTTP_LOG_FIELDS_DATA with the field information that will be logged for that response.
  2. The Base.Type member of the HTTP_LOG_FIELDS_DATA structure should be initialized to HttpLogDataTypeFields. The Base.Type field ensures the future extensibility of the structure and API.
  3. The application calls HttpSendHttpResponse or HttpSendResponseEntityBody with a pointer to the HTTP_LOG_FIELDS_DATA structure in the pLogData parameter. The application should type cast the pointer to PHTTP_LOG_DATA.

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。