Uploaded image for project: 'QuickFIX/J'
  1. QuickFIX/J
  2. QFJ-983

SLF4JLog is suffixing category with session ID instead of prefixing it.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 2.1.1
    • Fix Version/s: 2.2.0
    • Component/s: Engine
    • Labels:
    • Environment:
      N/A

      Description

      The property SLF4JLogPrependSessionID "Controls whether session ID is prepended to log message." This property is passed down to SLF4J and used in the method quickfix.SLF4JLog#getLogger.

      Based on the property name and description, one would think that the Session ID will appear as prefix of category. But the method getLogger suffixes category with session ID instead of prefixing it. I think this is a bug.

      Bug:

      private Logger getLogger(SessionID sessionID, String category, String defaultCategory, String logPrefix) {
          return LoggerFactory.getLogger((category != null
                  ? substituteVariables(sessionID, category)
                  : defaultCategory) + logPrefix);
      }
      

      Proposed Fix:

      private Logger getLogger(SessionID sessionID, String category, String defaultCategory, String logPrefix) {
          return LoggerFactory.getLogger(logPrefix + (category != null
                  ? substituteVariables(sessionID, category)
                  : defaultCategory));
      }
      

      Thanks!

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              simon.mebrahtu Simon Ogbamichael
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: