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

LoggingEvent#sequenceNumber always 0 event after configuring a SequenceNumberGenerator

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.3.0
    • 1.3.0-beta0
    • logback-classic
    • 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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: