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

LoggingEvent#sequenceNumber always 0 event after configuring a SequenceNumberGenerator

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.0-beta0
    • Fix Version/s: 1.3.0
    • Component/s: logback-classic
    • Labels:
      None

      Description

      The sequence number of logging events remains at 0 (zero) even after configuring a SequenceNumberGenerator in the LoggerContext.

      I tried to configure a sequence number generator in the logback.xml configuration file as follows:

      <configuration>
         <sequenceNumberGenerator class="ch.qos.logback.core.spi.BasicSequenceNumberGenerator"/>
        ...
      </configuration>
      

       
      Although this configuration is accepted without error/warning, a call to LoggerContext#getSequenceGenerator() at runtime always returns null.

      After some investigations it appears that LoggerContext#getSequenceNumber() is hardcoded to always return null (see here):

      public SequenceNumberGenerator getSequenceNumberGenerator()
      {
         return null;
      }
      

       

      Also LoggerContext extends ContextBase which also maintains a reference to a SequenceNumberGenerator together with the associated setter and getter methods.

      Looks like there is some confusion about which class should own the generator...

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ceki Ceki Gülcü
              Reporter:
              brenuart Bertrand Renuart
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: