0

I want to automatically delete my Wildfly logs after a certain period of time (e.g. 3 days). As I am running my application in a container which has no access to crontab, I want to do this via a JBoss Cli. I have already tried the following command, but the option seems not to be supported:

/subsystem=logging/periodic-size-rotating-file-handler=DELETELOG:add(autoflush=true,file={"relative-to"=>"jboss.server.log.dir","path"=>"deletelog.log"},suffix=".yyyy-MM-dd",append=true,rotate-size="10M",max-backup-index=3,level=DEBUG)

Currently, the above only writes an empty file without any data. I have also configured a logger and file handler which is called FILE, but which I cannot remove as it is configured as the ROOT logger.

I want to delete the log files after a certain amount of time in my application log directory with a JBoss-cli. Do you have any idea, how this can be achieved? Thank you in advance!

0 Answers0