HTTP 访问日志记录

可以为 HTTP 端点配置访问日志设置。

HTTP 访问日志设置

HTTP 访问日志包含由 HTTP 端点所处理的所有入站客户机请求的记录。可以在 HTTP 服务器中启用访问日志记录,或者使用下列两种方式在 Liberty 服务器中将其启用:多个端点共用一个日志,或者每个端点一个日志。
注: 如果您未指定属性,那么将使用缺省值。要查看缺省属性的列表,请参阅 Java Servlets 3.0 中 Liberty 配置元素列表中的 httpAccessLogging
  • 使用公共日志

    要对多个使用公共设置的端点启用日志记录,请将 httpAccessLogging 作为 server.xml 文件中的一个顶级元素,然后从多个 httpEndpoint 元素引用该元素:

    <httpAccessLogging id="accessLogging"/>
    <httpEndpoint id="defaulHttpEndpoint" accessLoggingRef="accessLogging"/>
    <httpEndpoint id="otherHttpEndpoint" accessLoggingRef="accessLogging" httpPort="9081" httpsPort="9444"/>
  • 对每个端点使用不同的日志

    要对每个端点启用日志记录,请使用 accessLogging 子元素并指定一个与其他日志不冲突的文件路径:

    <httpEndpoint id="defaultHttpEndpoint">
     	<accessLogging filepath="${server.output.dir}/logs/http_defaultEndpoint_access.log"/>
    </httpEndpoint>
  • 使用 HTTP 服务器的日志

    有关可用 HTTP 服务器端属性及其描述的列表,请参阅 Apache 模块 mod_log_config

HTTP 访问日志格式

有关可用日志格式属性及其描述的列表,请参阅 HTTP 传输通道定制属性中 WebSphere Application Server 传统版的 accessLogFormat 配置。在 server.xml 中使用 httpAcccessLogging 或 accessLogging 元素的 logFormat 属性来指定此日志格式字符串:

<httpAccessLogging logFormat='%h %u %{t}W "%r" %s %b'/>

<httpEndpoint id="defaultHttpEndpoint">
				<accessLogging filepath="${server.output.dir}/logs/http_defaultEndpoint_access.log"
                         logFormat='%h %i %u %t "%r" %s %b' />
	</httpEndpoint>

用于指示主题类型的图标 参考主题



时间戳记图标 最近一次更新时间: Monday, 5 December 2016
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-libcore-mp&topic=rwlp_http_accesslogs
文件名:rwlp_http_accesslogs.html