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

"Nested appenders are not allowed" warning using SiftingAppender

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.3.5, 1.4.5
    • 1.4.4
    • None

    Description

      Hi,

      I'm migrating from 1.2 to 1.4 and I have a SiftingAppender configured like the example shown in the manual (appender > sift > appender):

      https://logback.qos.ch/manual/appenders.html#SiftingAppender

      Nevertheless I'm getting the warning "As of logback version 1.3, nested appenders are not allowed", which causes Logback to print its full initalization log. Am I missing something?

      Relevant part of the XML configuration:

      <appender name="MY_LOG_APPENDER" class="ch.qos.logback.classic.sift.SiftingAppender">
          <!-- Useless but mandatory for SiftingAppender -->
          <discriminator>
              <key>dummy</key>
              <defaultValue>dummy</defaultValue>
          </discriminator>
          <!-- Avoid creation of unnecessary empty files -->
          <sift>
              <appender name="MY_LOG_APPENDER_SIFT" class="ch.qos.logback.core.rolling.RollingFileAppender">
                  <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
                      <fileNamePattern>${logs.directory}/mylog.%d.%i.log</fileNamePattern>
                      <maxFileSize>25MB</maxFileSize>
                      <maxHistory>30</maxHistory>
                      <totalSizeCap>250MB</totalSizeCap>
                      <cleanHistoryOnStart>true</cleanHistoryOnStart>
                  </rollingPolicy>
                  <encoder>
                      <pattern>%d{MMM dd HH:mm:ss} %hostaddr %msg%n</pattern>
                  </encoder>
              </appender>
          </sift>
      </appender>
      

      Thank you.


      Original post: https://github.com/qos-ch/logback/discussions/604

      Attachments

        Activity

          People

            ceki Ceki Gülcü
            albertus82 albertus82
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: