JBOSS 6.3 Access log auto deletion

268 Views Asked by At

I am looking for a solution in JBOSS EAP 6.3 for the automatic deletion of access logs. I have added the below configuration to get the access logs printed in a different file but it doesn't have any parameter to delete the files after a specific interval.

<access-log pattern="%h %l %u %t %r %s %b %S %T" prefix="access_log_" rotate="true">
    <directory path="." />
</access-log>
1

There are 1 best solutions below

3
A Kurian On

In standalone.xml , you can have log handler configuration based on the size.

  <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="1M"/>
                <max-backup-index value="1"/>
                <append value="true"/>
            </size-rotating-file-handler>