code: private String getSessionId(final HttpSession sess) {
      try {
        if (sess == null) {
          return "NO-SESSIONID";
        } else {
          return sess.getId();
        }
      } catch (Throwable t) {
        return "SESSION-ID-EXCEPTION";
      }
    }
docs: Get the session id for the loggers.
  
  @param sess
  @return  String    session id