Github user markt-asf commented on a diff in the pull request:

    https://github.com/apache/tomcat/pull/70#discussion_r129111529
  
    --- Diff: java/org/apache/catalina/valves/AbstractAccessLogValve.java ---
    @@ -1506,6 +1508,38 @@ public void addElement(CharArrayWriter buf, Date 
date, Request request,
             }
         }
     
    +    /**
    +     * Write connection status when response is completed - %X
    +     */
    +    protected static class ConnectionStatusElement implements 
AccessLogElement {
    +        @Override
    +        public void addElement(CharArrayWriter buf, Date date, Request 
request, Response response, long time) {
    +            if (response != null && request != null) {
    +                // Check for connection aborted cond
    +                boolean isConnAborted = false;
    +                if (response.isError()) {
    +                    Throwable ex = 
(Throwable)request.getAttribute(RequestDispatcher.ERROR_EXCEPTION);
    +                    if (ex instanceof ClientAbortException) {
    +                        isConnAborted = true;
    +                        buf.append('X');
    +                    }
    +                }
    +
    +                // Check whether connection is keep-alive or not
    +                if (!isConnAborted) {
    +                    if 
(org.apache.coyote.http11.Constants.KEEPALIVE.equals(
    +                            
request.getHeader(org.apache.coyote.http11.Constants.CONNECTION))) {
    --- End diff --
    
    The log message is intended to show if the connection remains in keep-alive 
after the current request finishes. You want to look at the Connection header 
(for close) on the response here to mimic the behaviour described for httpd.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to