Cannot get logback to roll PuppetDB log files

asked 2015-03-15 12:53:59 -0600

Joseph Carlos gravatar image

I have been trying to change the logback.xml file in /etc/puppetdb to rotate the PuppetDB log file, but to no avail. I have set the logback configuration to roll the log when the log file reaches 10KB (this, of course, is only for testing). However, the log file never seems to get rolled. I set the log level to "debug" and I can see that the log file grows by more than 10KB within a few seconds. I am using PuppetDB version 2.2.2 running on a Debian wheezy system.

Here is the configuration I am using:

# /etc/puppetdb/logback.xml
<configuration scan="true">
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%d %-5p [%c{2}] %m%n</pattern>
        </encoder>
    </appender>

    <appender name="F2" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>/var/log/puppetdb/puppetdb.log</file>
        <append>true</append>

        <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
          <fileNamePattern>puppetdb.%i.log</fileNamePattern>
          <minIndex>1</minIndex>
          <maxIndex>3</maxIndex>
        </rollingPolicy>

        <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
          <maxFileSize>10KB</maxFileSize>
        </triggeringPolicy>

        <encoder>
            <pattern>%d{yyyy-MM-dd'T'HH:mm:ss} %-5p [%c{2}] %m%n</pattern>
        </encoder>
    </appender>

    <!-- Supress internal ActiveMQ logging -->
    <logger name="org.apache.activemq" level="warn"/>

    <!-- Supress internal Spring Framework logging -->
    <logger name="org.springframework.jms.connection" level="warn"/>

    <!-- Lower the log level for ActiveMQ KahaDB MessageDatabase -->
    <logger name="org.apache.activemq.store.kahadb.MessageDatabase"
        level="info"/>

    <!-- Info level provides migration and index creation information -->
    <logger name="com.puppetlabs.puppetdb.scf.migrate" level="info"/>

    <root level="debug">
        <appender-ref ref="F2" />
    </root>
</configuration>
edit retag flag offensive close merge delete