Index: DefaultAccessLogFormatterImpl.java =================================================================== RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/web/accesslog/DefaultAccessLogFormatterImpl.java,v retrieving revision 1.7 diff -r1.7 DefaultAccessLogFormatterImpl.java 60a61,62 > import java.util.Iterator; > import org.apache.coyote.tomcat5.CoyoteResponseFacade; 107a110,115 > private static final String RESPONSE_HEADER_BY_NAME_PREFIX = "response.header."; > private static final int RESPONSE_HEADER_BY_NAME_PREFIX_LEN > = RESPONSE_HEADER_BY_NAME_PREFIX.length(); > private static final String RESPONSE_HEADERS_BY_NAME_PREFIX = "response.headers."; > private static final int RESPONSE_HEADERS_BY_NAME_PREFIX_LEN > = RESPONSE_HEADERS_BY_NAME_PREFIX.length(); 170a179,180 > ServletResponse resp = response.getResponse(); > HttpServletResponse hresp = (HttpServletResponse) resp; 241a252,259 > } else if (pc.startsWith(RESPONSE_HEADER_BY_NAME_PREFIX)) { > appendResponseHeaderByName(charBuffer, > pc.substring(RESPONSE_HEADER_BY_NAME_PREFIX_LEN), > hresp); > } else if (pc.startsWith(RESPONSE_HEADERS_BY_NAME_PREFIX)) { > appendResponseHeadersByName(charBuffer, > pc.substring(RESPONSE_HEADERS_BY_NAME_PREFIX_LEN), > hresp); 309c327,329 < && !component.startsWith(HEADERS_BY_NAME_PREFIX)) { --- > && !component.startsWith(HEADERS_BY_NAME_PREFIX) > && !component.startsWith(RESPONSE_HEADER_BY_NAME_PREFIX) > && !component.startsWith(RESPONSE_HEADERS_BY_NAME_PREFIX)) { 581a602,621 > /* > * Appends the value of the header with the specified name in the given > * response to the given char buffer, or NULL-RESPONSE-HEADER- if no > * header with the given name is present in the response. > */ > private void appendResponseHeaderByName(CharBuffer cb, > String headerName, > HttpServletResponse hresp) { > if (headerName == null) { > throw new IllegalArgumentException("Null response header name"); > } > > cb.put(QUOTE); > String value = ((CoyoteResponseFacade)hresp).getUnwrappedCoyoteResponse().getHeader(headerName); > if (value == null) { > value = "NULL-RESPONSE-HEADER-" + headerName.toUpperCase(); > } > cb.put(value); > cb.put(QUOTE); > } 616a657,685 > /* > * Appends the values (separated by ";") of all headers with the > * specified name in the given response to the given char buffer, or > * NULL-RESPONSE-HEADERS- if no headers with the given name are > * present in the response. > */ > private void appendResponseHeadersByName(CharBuffer cb, > String headerName, > HttpServletResponse hresp) { > if (headerName == null) { > throw new IllegalArgumentException("Null response header name"); > } > > cb.put(QUOTE); > String[] headerValues = ((CoyoteResponseFacade)hresp).getUnwrappedCoyoteResponse().getHeaderValues(headerName); > boolean first = true; > for (int i=0;i if (first) { > first = false; > } else { > cb.put(";"); > } > cb.put(headerValues[i]); > } > if (first) { > cb.put("NULL-RESPONSE-HEADERS-" + headerName.toUpperCase()); > } > cb.put(QUOTE); > }