Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-1219

logback-access exceptions during logout

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.3.0-alpha7
    • 1.1.7
    • logback-access
    • None
    • Jetty 9.3.9, dropwizard-1.0.2-like configuration.

    Description

      AccessEvent#247 tries to do httpRequest.getSession(), then check if the return value is null.

      However, the no-args getSession() will always return a valid session: it creates it if it is not present. During a log-out (i.e. after we've just destroyed the session), trying to create a new session fails with:

      {{
      12:03:35,640 |-ERROR in ch.qos.logback.core.ConsoleAppender[STDOUT] - Appender [STDOUT] failed to append. java.lang.IllegalStateException: Response is committed
      at java.lang.IllegalStateException: Response is committed
      at at org.eclipse.jetty.server.Request.getSession(Request.java:1508)
      at at org.eclipse.jetty.server.Request.getSession(Request.java:1486)
      at at ch.qos.logback.access.spi.AccessEvent.getSessionID(AccessEvent.java:247)
      at at ch.qos.logback.access.pattern.SessionIDConverter.convert(SessionIDConverter.java:21)
      at at ch.qos.logback.access.pattern.SessionIDConverter.convert(SessionIDConverter.java:18)
      at at ch.qos.logback.core.pattern.FormattingConverter.write(FormattingConverter.java:36)
      }}

      To trigger this, your pattern must contain the %S modifier.

      Proposed fix: call the getSession(false) variant, which does not try to create a session if one is not present, and instead hits the null case as the code is expecting.

      Attachments

        Activity

          People

            ceki Ceki Gülcü
            faux Chris West
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: