2

I'm using log4cxx and with the following configuration, I understand I can roll a log every hour, minute, day and so on.

            <rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
              <param name="FileNamePattern" value="loog.%d{yyyy-MM-dd-HH}.log"/>
            </rollingPolicy>

How can I roll the logs every 30 minutes? What is the configuration for this? Can I do this via the configuration?

Bart
  • 19,692
  • 7
  • 68
  • 77
DarthVader
  • 52,984
  • 76
  • 209
  • 300

1 Answers1

2

No, you can't do it without a change in the implementation (i.e. extending TimeBasedRollingPolicy, RollingFileAppender and maybe more). It's just how it works, rollover is done when the full unit (a day, hour, minute, etc.) changes. There's no way to specify more than one unit.

MaDa
  • 10,511
  • 9
  • 46
  • 84