如何设定access log中的authenticated username?

rottenapple 2009-11-09 03:01:49
在阿帕奇的web access log中,有一个是用户名选项,默认是域用户名。如果我用的是form 方式登陆,想把这个用户名写到access log中怎么实现?
...全文
58 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
swandragon 2009-11-10
  • 打赏
  • 举报
回复
不知道,没弄过这东西
rottenapple 2009-11-10
  • 打赏
  • 举报
回复
没人知道么?不会把!!!
rottenapple 2009-11-09
  • 打赏
  • 举报
回复
楼上的, 现在的access log 是这样的
2009-07-04 02:16:37 110.110.110.246 Domain\UserName 110.110.110.110 GET /images/btn_news.gif - 200 0 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+Core+4.1.0;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727;+.NET+CLR+3.0.04506.30;+.NET+CLR+3.0.04506.648;+.NET+CLR+3.5.21022)

我需要的是
2009-07-04 02:16:37 110.110.110.246 form_username 110.110.110.110 GET /images/btn_news.gif - 200 0 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+Core+4.1.0;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727;+.NET+CLR+3.0.04506.30;+.NET+CLR+3.0.04506.648;+.NET+CLR+3.5.21022)
JavaAlpha 2009-11-09
  • 打赏
  • 举报
回复
不太明白 楼主的意思
youjianbo_han_87 2009-11-09
  • 打赏
  • 举报
回复
这个没做过,去官方网站上下他的sample的,肯定会有例子的。
阁楼上的伟哥 2009-11-09
  • 打赏
  • 举报
回复
这个不太懂……

顶一下
deploy/jbossweb-tomcat55.sar/server.xml http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html pattern配置: %a - Remote IP address %A - Local IP address %b - Bytes sent, excluding HTTP headers, or '-' if zero %B - Bytes sent, excluding HTTP headers %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 %S - User session ID %t - Date and time, in Common Log Format %u - Remote user that was authenticated (if any), else '-' %U - Requested URL path %v - Local server name %D - Time taken to process the request, in millis %T - Time taken to process the request, in seconds %I - current request thread name (can compare later with stacktraces) There is also support to write information from the cookie, incoming header, outgoing response headers, the Session or something else in the ServletRequest. It is modeled after the apache syntax: %{xxx}i for incoming request headers %{xxx}o for outgoing response headers %{xxx}c for a specific request cookie %{xxx}r xxx is an attribute in the ServletRequest %{xxx}s xxx is an attribute in the HttpSession The shorthand pattern name common (which is also the default) corresponds to '%h %l %u %t "%r" %s %b'.

81,091

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧