FileDocCategorySizeDatePackage
CombinedAccessLogFormatterImpl.javaAPI DocGlassfish v2 API4267Fri May 04 22:36:04 BST 2007com.sun.enterprise.web.accesslog

CombinedAccessLogFormatterImpl

public class CombinedAccessLogFormatterImpl extends CommonAccessLogFormatterImpl
Access log formatter using the combined access log format from Apache.

Fields Summary
Constructors Summary
Methods Summary
public voidappendLogEntry(org.apache.catalina.Request request, org.apache.catalina.Response response, java.nio.CharBuffer charBuffer)
Appends an access log entry line, with info obtained from the given request and response objects, to the given CharBuffer.

param
request The request object from which to obtain access log info
param
response The response object from which to obtain access log info
param
charBuffer The CharBuffer to which to append access log info


        super.appendLogEntry(request, response, charBuffer);

        ServletRequest req = request.getRequest();
        HttpServletRequest hreq = (HttpServletRequest) req;

        appendReferer(charBuffer, hreq);
        charBuffer.put(SPACE);

        appendUserAgent(charBuffer, hreq);
    
private voidappendReferer(java.nio.CharBuffer cb, javax.servlet.http.HttpServletRequest hreq)

        cb.put("\"");
        String referer = hreq.getHeader("referer");
        if (referer == null) {
            referer = NULL_VALUE;
        }
        cb.put(referer);
        cb.put("\"");
    
private voidappendUserAgent(java.nio.CharBuffer cb, javax.servlet.http.HttpServletRequest hreq)

        cb.put("\"");
        String ua = hreq.getHeader("user-agent");
        if (ua == null) {
            ua = NULL_VALUE;
        }
        cb.put(ua);
        cb.put("\"");