IHS的access_log的日子格式设置

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 
版权声明:本文为博主原创文章,转载请附上博文链接!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值