logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Thomas <greg.d.tho...@gmail.com>
Subject Zipped rolling file - name of file entry
Date Thu, 08 Dec 2016 14:07:45 GMT
I'm using a RollingFileAppender, configured similar to ...

<Appenders>
    <RollingFile name="rf" fileName="../logs/my.log"
filePattern="../logs/my.%i.log.zip">
        <PatternLayout>
            <pattern>%d %-5p [%c{1}] %X - %m%n</pattern>
        </PatternLayout>
        <Policies>
            <SizeBasedTriggeringPolicy size="100 MB"/>
        </Policies>
        <DefaultRolloverStrategy max="20"/>
    </RollingFile>
</Appenders>


So far so good. I get 20 logs files, my.1.log.zip -> my.20.log.zip, as I
would expect.

However, the file contained with "my.20.log.zip" is called ...
"my.1.log.zip". In fact, every log file contains a file of the same name,
"my.1.log.zip".

Whilst I can see why this would be the case, it still breaks the principle
of least surprise in my mind. Is there a configuration option I can use to
avoid this - or any other mechanism I missed that would use a more natural
file naming mechanism?

Thanks,

Greg

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message