SonarQube Server - Log Rotation Policy

We need to set the log rotation policy on our SonarQube Server to 2-3 Weeks.

Please help in the sonar.properties configurations that we need to take care of in this context,

Hi @Tripti_Mittal,

The two properties you should look at are sonar.log.rollingPolicy and sonar.log.maxFiles.

  • sonar.log.rollingPolicy can be set to yyyy-MM-DD for daily rotation (the default) or yyyy-MM for monthly
  • sonar.log.maxFiles then controls how many of those files are retained.

It sounds like you should set daily log rotation and keep 14-21 files. It’s not possible to set a number of weeks as the per-file rotation policy (and this would create pretty large log files anyway).

Regards,

Cameron.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.