Score:0

Automatically delete log files with JBoss CLI for Wildfly application

pf flag

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!

Hannes Oberberger avatar
pf flag
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)
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.