Tomcat4.1自动生成日志文件系统配置方法

时间:2010-01-19 08:57:39   来源:第二电脑网  作者:第二电脑网

  第二电脑网导读:: <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...." ---日志字段参数 reso...
  正文:

Tomcat4.1自动生成日志文件系统配置方法 编辑Tomcat/conf/server.xml文件,找到如下行: <Context path="/examples" docBase="examples" debug="0" reloadable="true" crossContext="true"> 说明:examples就是WEBAPP名字,找到对应的名字, 增加下面的行: <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 (本地服务器名)


来源:http://www.002pc.com/master/College/Programming/JSP/12054.html

收藏到:

关于《Tomcat4.1自动生成日志文件系统配置方法》文章的评论

共有 0 位网友发表了评论 此处只显示部分留言 点击查看完整评论页面

随机文章

    SQL Error: select * from ***_ecms_article where classid='85' and checked=1 order by rand() limit 10

顶出来的热门

    SQL Error: select * from ***_ecms_article where classid='85' and checked=1 order by diggtop desc,id desc limit 10
站内搜索: 高级搜索

热门搜索: Windows style 系统 tr IP QQ CPU 安装 function 注册 if td