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-rotating-file-handler=FILE:write-attribute(name=max-backup-index, value=3)

Do you have any idea, how this can be achieved? Thank you in advance!

  • I have also tried the following, but the command still writes an exmpty file: /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) – Hannes Oberberger Aug 16 '23 at 05:48

0 Answers0