85427617 2010-05-21
在tomcat的server.xml中添加如下代码:
<Valveclassname="org.apache.catalina.valves.AccessLogValve"
directory="logs"prefix="localhost_access_log."suffix=".txt"
pattern="%h%l%u%t"%r"%s%b"%{Referer}i""%{User-Agent}i""%{Cookie}i""%{Host}i""resolveHosts="false"/>
directory="logs"是将日志生成到tomcat下面的logs文件夹中
prefix="localhost_access_log."生成日志的命名
配置虚拟目录
<Contextpath="/webstat"
docBase="x:/tomcat5.5/logs"
crossContext="true"
debug="0"
reloadable="true"
trusted="false">
<Valveclassname="org.apache.catalina.valves.RemoteAddrValve"
allow="XXX.XXX.XXX.XXX"/>
</Context>
allow="XXX.XXX.XXX.XXX"可以设置访问的IP