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

Logback: After upgrading to 1.3.6 with SLF4J 2.0.4, logs are being written to unknown.log file.

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.3.6
    • logback-core

    Description

      Hi Team,

       

      After upgrading the logback-classic and logback-core to 1.3.6 along with SLF4J to 2.0.4, the logs are being written to unknown.log file. 

      Our config looks exactly like below. 

      <configuration> <appender name="SIFT" class="ch.qos.logback.classic.sift.SiftingAppender">
            <discriminator class="ch.qos.logback.classic.sift.JNDIBasedContextDiscriminator">
               <DefaultValue>unknown</DefaultValue>
            </discriminator>
            <sift>
               <appender name="FILE-${contextName}" class="ch.qos.logback.core.rolling.RollingFileAppender">
                  <File>${catalina.base}/logs/${contextName}.log</File>
                  <append>true</append>
                  <immediateFlush>true</immediateFlush>
                  <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
                     <fileNamePattern>${catalina.base}/logs/${contextName}.%i.log.zip</fileNamePattern>
                     <minIndex>1</minIndex>
                     <maxIndex>3</maxIndex>
                  </rollingPolicy>
                  <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
                     <maxFileSize>20MB</maxFileSize>
                  </triggeringPolicy>
                  <encoder>
                     <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS}|%-5level|${HOSTNAME}|%msg ||%class:%line %xException{full} %n</pattern>
                  </encoder>
               </appender>
            </sift>
          </appender>
         <root level="INFO">
            <appender-ref ref="SIFT" />
         </root> </configuration> 

      Our previous version was: logback: 1.2.11 with SLF4J at version 1.7.36.

      Note: All the required config described in the documentation for JNDI is as is and has not changed. 

      Any pointers to resolve this issue would be great help.

       

      Thanks,

      Lakshmikanth 

       

      Attachments

        Activity

          People

            logback-dev Logback dev list
            lakshmikanth5 Lakshmikanth Reddy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: