Old log files not purged after changing config file and resetting the server

  • Versions:
    • SonarQube Community Edition 8.9 LTS
    • SonarScanner 4.6.2
  • Trying to achieve:
    • Only keep today’s and yesterday’s logs
  • I’ve tried setting these environment variables in my docker-compose.yml:
    • SONAR_LOG_MAXFILES=2
    • SONAR_LOG_ROLLINGPOLICY=time:yyyy-MM-dd

My question:
I still see more than 2 log files per type, why aren’t them purged?

Thanks in advance.

Hello Marco,
Did you ever find a solution to your problem? I stumbled across the same issue with SonarQube Community 9.9.3 LTS on Kubernetes. Setting “SONAR_LOG_MAXFILES” to “5” does not purge Sonar log files with 6 or more days of age.

It looks like simply stopping and restarting SonarQube is not sufficient. So I waited until the next day. During the night SonarQube rotated the log files and indeed purged the old log files. So the SONAR_LOG_MAXFILES mechanism actually works.