On Apr 29, 2008, at 11:38 AM, Dale King wrote:
I was testing out rolling file appenders (in Windows) which I set to
rollover every minute so I can see what happens. Here is the appender:
<appender name="xmlfile"
class="org.apache.log4j.rolling.RollingFileAppender">
<param name="filename" value="log\log-current.xml"/>
<rollingPolicy
class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
<param name="FileNamePattern" value="log\log
%d{HH_mm}.xml.zip"/>
</rollingPolicy>
<layout class="org.apache.log4j.XMLLayout">
<param name="properties" value="true"/>
<param name="locationinfo" value="true"/>
</layout>
</appender>
It works fine if the .zip is not on there. With the .zip on there at
the top of the minute the file gets renamed to something like
log12_30.xml (no zip extenstion) and no new file is created so there
are no more logging events to the file system. I tried it without
using a directory in the name and it still did it.
--
Dale King
Do you have a zip.exe on the path? Compression relies on either a
gzip (if the extension is .gz) or zip executable to be on the path.
There is a zip utility in the Win32 API in the shell.lib if I recall,
but log4cxx does not attempt to use that.
The behavior when zip or gzip is missing likely could be improved.