IHS(IBM HTTP Server )的access.log可以记录http server处理的类,对象的时间,但是不能输出持续的时间,在性能测试的过程中,如果需要统计http server消耗的时间,就必须要改一下access.log的设置。
以下是access.log的配置文件httpd.conf的代码片段
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b " common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
#
# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a <VirtualHost>
# container, they will be logged here. Contrariwise, if you *do*
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
#
CustomLog logs/access_log common
如果需要输出持续时间,需要把
LogFormat "%h %l %u %t \"%r\" %>s %b " common 改为
LogFormat "%h %l %u %t %T \"%r\" %>s %b %T" common
如果需要将access.log按日期和大小分开存放,需要把
CustomLog logs/access_log common改为
CustomLog "|/appl/was/IHS/HTTPServer/bin/rotatelogs /appl/was/IHS/HTTPServer/logs/ls32_access.log%Y%m%d 10M %t" common
最后的httpd.conf即为:
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t %T \"%r\" %>s %b %T" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
#
# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a <VirtualHost>
# container, they will be logged here. Contrariwise, if you *do*
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
#
CustomLog "|/appl/was/IHS/HTTPServer/bin/rotatelogs /appl/was/IHS/HTTPServer/logs/ls32_access.log%Y%m%d 10M %t" common
CustomLog "|/appl/was/IHS/HTTPServer/bin/rotatelogs /appl/was/IHS/HTTPServer/logs/ls32_access.log%Y%m%d 8600 480 " common
apache&IHS的日志切割方法,只需要修改httpd.conf(conf目录下)文件的CustomLog或ErrorLog部分即可,见下:
CustomLog “|bin/rotatelogs.exe e:\weblog\access%Y%m%d.log 86400 480″common
或
ErrorLog “|bin/rotatelogs.exe e:\weblog\access%Y%m%d.log 86400 480″
---------------------
作者:达摩院扫地僧
来源:CSDN
原文:https://blog.csdn.net/yougou_sully/article/details/80419955
版权声明:本文为博主原创文章,转载请附上博文链接!