I'm getting the logs from different services and stored in server.log with pattern.
server.log.2019-02-01 ...... ......sever.log.2019-02-15.
Tried in this way
I previously used periodic-rotating-file-handler which doesn't delete the files, so later updated to size-rotating-file-handler which will rotate the logs only if the file reaches to the max value.so, now i'm using the periodic-size-rotating-file-handler which will rotate the logs even if the logs doesn't reach the max value, but older logs are not getting deleted.
My Code:
<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="20M"/>
<max-backup-index value="5"/>
<append value="true"/>
<suffix value=".yyyy-MM-dd"/>
</size-rotating-file-handler>
Expected Behavior:
I expect the logs files should rotate according to the size and periodic-file-handler does and also should delete the older files keeping 5 days backup.