Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wildfly 18 log strategy doesn't respect max-backup-index and keeps all server.log files

We have a WildFly 18 with the following logging strategy:

<server xmlns="urn:jboss:domain:10.0">
    ...
    <profile>
        ...
        <subsystem xmlns="urn:jboss:domain:logging:8.0">
            ...
            <periodic-size-rotating-file-handler name="FILE" autoflush="true">
                <formatter>
                    <named-formatter name="PATTERN"/>
                </formatter>
                <file relative-to="jboss.server.log.dir" path="server.log"/>
                <rotate-size value="100M"/>
                <max-backup-index value="10"/>
                <suffix value=".yyyy-MM-dd"/>
                <append value="true"/>
            </periodic-size-rotating-file-handler>

Even though we specify a periodic-size-rotating-file-handler with a max-backup-index, all server.log files are kept and never removed:

endless list of server.log files

What are we doing wrong here?

like image 439
Xavier Portebois Avatar asked Sep 12 '25 17:09

Xavier Portebois


1 Answers

The max-backup-index is only used for files not rotated by the date. See https://wildscribe.github.io/WildFly/18.0/subsystem/logging/periodic-size-rotating-file-handler/index.html. There is an old issue which asks for this ability, but it requires assumptions to be made about file names.

like image 113
James R. Perkins Avatar answered Sep 14 '25 12:09

James R. Perkins