配置方法,在conf/server.xml中打开(默认关闭的)

<Valve className="org.apache.catalina.valves.AccessLogValve">
prefix="localhost_access_log." suffix=".log"
pattern=" common " directory="${jboss.server.log.dir}"
resolveHosts="false"/>

最重要的参数:
common的值:%h %l %u %t %r %s %b
combined的值:%h %l %u %t %r %s %b %{Referer}i %{User-Agent}i
填写 common,日志中将包含下面信息:
访问者IP 访问时间 访问方式以及uri 返回状态 反应时间

192.168.1.102 - - [13/Dec/2011:17:14:33 +0800] "POST /member/isEmailExist HTTP/1.1" 200 84
192.168.1.102 - - [13/Dec/2011:17:40:56 +0800] "POST /member/decode HTTP/1.1" 404 -
192.168.1.102 - - [13/Dec/2011:17:41:30 +0800] "POST /ToolsWS/common/decode HTTP/1.1" 200 71 

如果填写 combined ,将有referer和ua信息,如下:

192.168.1.102 - - [13/Dec/2011:18:01:46 +0800] "GET /favicon.ico HTTP/1.1" 404 47 "-" "Mozilla/5.0 (X11; U; Linux x86_64; zh-CN; rv:1.9.2.24) Gecko/20111107 Ubuntu/10.04 (lucid) Firefox/3.6.24" 
192.168.1.102 - - [13/Dec/2011:18:02:09 +0800] "GET /admin-console/index.seam HTTP/1.1" 200 1821 "-" "Mozilla/5.0 (X11; U; Linux x86_64; zh-CN; rv:1.9.2.24) Gecko/20111107 Ubuntu/10.04 (lucid) Firefox/3.6.24"
192.168.1.102 - - [13/Dec/2011:18:02:09 +0800] "GET /admin-console/a4j/s/3_3_3.Finalorg/richfaces/renderkit/html/css/basic_classes.xcss/DATB/eAHTj7jOHbp8hjQADb0DGQ__ HTTP/1.1" 200 7126 "http://192.168.1.53:8080/admin-console/index.seam" "Mozilla/5.0 (X11; U; Linux x86_64; zh-CN; rv:1.9.2.24) Gecko/20111107 Ubuntu/10.04 (lucid) Firefox/3.6.24"
%a     访问者的IP
%A 本地服务器的IP
%b 发送的字节数,不包括http头,如果字节数为0的话,显示为-
%B 发送的字节数,不包括http头. 
%h 访问者主机名,如果resolveHosts为false的话,这里就是IP地址了
%H 访问者使用的协议,如:HTTP/1.1
%l always return '-' ,从identd返回的访问者逻辑用户名
%m 访问的方式,是GET还是POST
%p 本地接收访问的端口
%q 查询字符串,比如你访问的是aaa.jsp?bbb=ccc,那么这里就显示?bbb=ccc
%r 请求的第一行,包含请求方法和URI
%s 响应的状态码
%S 用户的session ID
%t 日志和时间,使用通常的Log格式
%u 认证以后的远端用户,不存在就是"-"
%U 访问的URI路径
%v 本地服务器名称
%D 处理请求的时间,以毫秒记
%T 处理请求的时间,以秒记

eg:配置
        <div>
            <span style="font-size:16px;">pattern="</span><span style="font-size:16px;">192.168.1.54:</span><span style="font-size:16px;">&nbsp;%a&nbsp;</span><span style="font-size:16px;">%A</span><span style="font-size:16px;">&nbsp;%b&nbsp;</span><span style="font-size:16px;">%B</span><span style="font-size:16px;">&nbsp;%h&nbsp;</span><span style="font-size:16px;">%H</span><span style="font-size:16px;">&nbsp;%l&nbsp;</span><span style="font-size:16px;">%m</span><span style="font-size:16px;">&nbsp;%p&nbsp;</span><span style="font-size:16px;">%q&nbsp;</span><span style="font-size:16px;">%r&nbsp;</span><span style="font-size:16px;">%s&nbsp;</span><span style="font-size:16px;">%S&nbsp;</span><span style="font-size:16px;">%t&nbsp;</span><span style="font-size:16px;">%u&nbsp;</span><span style="font-size:16px;">%U</span><span style="font-size:16px;">&nbsp;%v&nbsp;</span><span style="font-size:16px;">%D</span><span style="font-size:16px;">&nbsp;%T&nbsp;</span><span style="font-size:16px;">%{Referer}i</span><span style="font-size:16px;">&nbsp;</span><span style="font-size:16px;">%{User-Agent}i&nbsp;</span><span style="font-size:16px;">%{X-Forwarded-For-Pound}i</span><span style="font-size:16px;">&nbsp;</span><span style="font-size:16px;">%{HTTP_X_UP_CALLING_LINE_ID}i</span><span style="font-size:16px;">&nbsp;</span><span style="font-size:16px;">%{x-up-calling-line-id}i&nbsp;</span><span style="font-size:16px;">"&nbsp;</span> 
        </div>

        <div style="color:#3333FF;">
            <i><span style="font-size:16px;">访问:</span><i> 
            <div>
                <span><i> 
                <div>
                    <i> 
                    <div>
                        <span><span><i> 
                        <div>
                            <span style="font-size:16px;">http://192.168.1.54:8080/ToolsWS</span> 
                        </div>

                    </div>

                </div>

            </div>

        </div>
        <div style="color:#3333FF;">
            <span style="font-size:16px;">日志将记录:</span> 
        </div>
        <div>
            <i> 
            <div>
                <span><span><i></i></span></span> 
                <div>
                    <span></span> 
                    <div>
                        <span><i></i></span> 
                        <div>
                            <span><span><i> 
                            <div>
                                <i> 
                                <div>
                                    <span><span><i> 
                                    <div>
                                        <i> 
                                        <div>
                                            <span><span><i> 
                                            <div>
                                                <div>
                                                    <span style="font-size:16px;">192.168.1.54:&nbsp;</span><span style="font-size:16px;">192.168.1.102</span><span style="font-size:16px;">&nbsp;127.0.0.1&nbsp;</span><span style="font-size:16px;">367</span><span style="font-size:16px;">&nbsp;367&nbsp;</span><span style="font-size:16px;">192.168.1.102</span><span style="font-size:16px;">&nbsp;HTTP/1.1&nbsp;</span><span style="font-size:16px;">-</span><span style="font-size:16px;">&nbsp;GET&nbsp;</span><span style="font-size:16px;">8080</span><span style="font-size:16px;">&nbsp;?stylesheet=1&nbsp;</span><span style="font-size:16px;">GET /ToolsWS/?stylesheet=1 HTTP/1.1</span><span style="font-size:16px;">&nbsp;200&nbsp;</span><span style="font-size:16px;">-</span><span style="font-size:16px;">&nbsp;[19/Jan/2012:15:37:57 +0800]&nbsp;</span><span style="font-size:16px;">-</span><span style="font-size:16px;">&nbsp;/ToolsWS/&nbsp;</span><span style="font-size:16px;">192.168.1.54</span><span style="font-size:16px;">&nbsp;11</span><span style="font-size:16px;">0.011</span><span style="font-size:16px;">&nbsp;http://192.168.1.54:8080/ToolsWS&nbsp;</span><span style="font-size:16px;">Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.7</span><span style="font-size:16px;">&nbsp;-&nbsp;</span><span style="font-size:16px;">-</span><span style="font-size:16px;">&nbsp;-</span> 
                                                </div>
                                            </div>

                                        </div>

                                    </div>

                                </div>

                            </div>

                        </div>
                    </div>
                    <div>
                        <i></i> 
                        <div>
                            <i><span><i></i></span></i> 
                            <div>
                                <i><i></i></i> 
                                <div>
                                    <i><span><span><i></i></span></span></i> 
                                    <div>
                                        <i><i></i></i> 
                                        <div>
                                            <i><span><span><i></i></span></span></i> 
                                            <div>
                                                <i><span style="font-size:16px;">推荐使用:</span></i>
                                                <div>
                                                    <div>
                                                        <i><span><i></i></span></i> 
                                                        <div>
                                                            <i><i></i></i> 
                                                            <div>
                                                                <i><span><span><i></i></span></span></i> 
                                                                <div>
                                                                    <i><i></i></i> 
                                                                    <div>
                                                                        <i><span><span><i></i></span></span></i> 
                                                                        <div>
                                                                            <i></i> 
                                                                            <div>
                                                                                <i><i></i></i> 
                                                                                <div>
                                                                                    <i><span><i></i></span></i> 
                                                                                    <div>
                                                                                        <i><i></i></i> 
                                                                                        <div>
                                                                                            <i><span><span><i></i></span></span></i> 
                                                                                            <div>
                                                                                                <i><i></i></i> 
                                                                                                <div>
                                                                                                    <i><span><span><i></i></span></span></i> 
                                                                                                    <div>
                                                                                                        <i></i> 
                                                                                                        <div>
                                                                                                            <i><i></i></i> 
                                                                                                            <div>
                                                                                                                <i><i><span><i></i></span></i></i> 
                                                                                                                <div>
                                                                                                                    <i><i><i></i></i></i> 
                                                                                                                    <div>
                                                                                                                        <i><i><span><span><i></i></span></span></i></i> 
                                                                                                                        <div>
                                                                                                                            <i><i><i></i></i></i> 
                                                                                                                            <div>
                                                                                                                                <i><i><span><span><i></i></span></span></i></i> 
                                                                                                                                <div>
                                                                                                                                    <i><i><span></span></i></i> 
                                                                                                                                    <div>
                                                                                                                                        <i><i><span><i></i></span></i></i> 
                                                                                                                                        <div>
                                                                                                                                            <i><i><span><i><span><i></i></span></i></span></i> 
                                                                                                                                            <div>
                                                                                                                                                <i><span><i><i></i></i></span></i> 
                                                                                                                                                <div>
                                                                                                                                                    <i><span><i><span><span><i> 
                                                                                                                                                    <div>
                                                                                                                                                        <i> 
                                                                                                                                                        <div>
                                                                                                                                                            <span><i> 
                                                                                                                                                            <div>
                                                                                                                                                                <i> 
                                                                                                                                                                <div>
                                                                                                                                                                    <span><span><i> 
                                                                                                                                                                    <div>
                                                                                                                                                                        <span style="font-size:16px;">pattern="</span><span style="font-size:16px;">%a&nbsp;%b&nbsp;%t&nbsp;%u&nbsp;%U&nbsp;%v&nbsp;%D&nbsp;%T&nbsp;%{Referer}i&nbsp;%{User-Agent}i&nbsp;</span><span style="font-size:16px;">"&nbsp;</span>
                                                                                                                                                                    </div>

                                                                                                                                                                </div>

                                                                                                                                                            </div>

                                                                                                                                                        </div>

                                                                                                                                                    </div>

                                                                                                                                                </div>
                                                                                                                                            </div>

                                                                                                                                        </div>
                                                                                                                                    </div>
                                                                                                                                </div>
                                                                                                                            </div>
                                                                                                                        </div>
                                                                                                                    </div>
                                                                                                                </div>
                                                                                                            </div>
                                                                                                        </div>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                        </div>
                                                                                    </div>
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>

    </div>
</div>