tomcat的配置文件

增加下面的行:

<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="bbs_access_log." suffix=".log" pattern="%a-%h-%b-%B-%H-%m-%q-%r-%s-%t-%U-%v" resolveHosts="false"/>

语法说明: directory="logs" ----存放日志的目录,请不要修改

prefix="bbs_access_log." ----日志文件名

suffix=".log" ---日志文件扩展名

pattern="%a...." ---日志字段参数

resolveHosts="false" --- 参数说明:

%a - Remote IP address(远程IP地址)

%A - Local IP address (本地IP地址)

%b - Bytes sent, excluding HTTP headers, or ′-′ if zero(字节流出,排除HTTP头,如果是零字节,用′-′隔开)

%B - Bytes sent, excluding HTTP headers(字节流出,排除HTTP头)

%h - Remote host name (or IP address if resolveHosts is false)(远程主机名)

%H - Request protocol(远程请求主机端口)

%l - Remote logical username from identd (always returns ′-′) (远程用户名识别)

%m - Request method (GET, POST, etc.) (请求方式)

%p - Local port on which this request was received

%q - Query string (prepended with a ′?′ if it exists) 查询字符串(如果存在,以 '?'开始)

%r - First line of the request (method and request URI)(首行提交)

%s - HTTP status code of the response (返回HTTP状态代码)

%S - User session ID (获取用户会话ID)

%t - Date and time, in Common Log Format (记录提交时间)

%u - Remote user that was authenticated (if any), else ′-′ (识别远程用户在什么地方)

%U - Requested URL path (被请求的URL路径)

%v - Local server name (本地服务器名)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值