Home > Software design >  How to set log Rotation in Quarkus on time basis?
How to set log Rotation in Quarkus on time basis?

Time:01-24

I am building an application using Quarkus and i am using logging. How could i set log rotation on daily basis or any given time basis?

I didn't get anything related this on https://quarkus.io/guides/logging.

CodePudding user response:

If you set quarkus.log.file.rotation.file-suffix the file will automatically be rotated based on the suffix you select (see this for more information). However, the file will also be rotated when quarkus.log.file.rotation.max-file-size is reached (it defaults to 10MB if not set). So if you never want this to happen, you will have to set quarkus.log.file.rotation.max-file-size to some very large value.

CodePudding user response:

In application.properties file add max-file-size to a large number and and set suffix with : .yyy-MM-dd

quarkus.log.console.json=true

quarkus.log.file.enable=true
quarkus.log.file.level=INFO
quarkus.log.file.path=my-app.log
quarkus.log.file.rotation.max-backup-index=30
quarkus.log.file.rotation.file-suffix=.yyyy-MM-dd
quarkus.log.file.rotation.max-file-size=1000M
  • Related