DEBUG mode in sonarqube gradle plugin

Sonar Server : v2025.2
Sonar gradle plugin : 6.1.0.5360
scanner-java-library: 3.3.1.450

Hi there,

I was using the sonar-gradle plugin version 5.1.0.4882 which had the support of displaying sonar debug logs us the SonarTask.useLoggerLevel.
However this no longer works with version 6.1.0 . I was unable to see debug logs even in the gradle debug mode.

What would be the correct way to get sonarqube debug logs now?

EDIT: Using the debug mode of gradle is not an option for me :confused: .The debug logs for my project are about 7.8 GB is size.

1 Like

Hello @sonardroid,

I’ve been experimenting with sonar.log.level, but I haven’t noticed any difference in the logs Gradle generates. I run Gradle at the INFO level using ./gradlew sonar -info. Are you looking for a specific part of the logs that’s missing?

If the logs are too large for your needs, have you considered filtering them? For example, you could use: ./gradlew sonar -debug | grep "\[org.sonarsource.scanner.lib.internal.facade.forked".

Hi @erwan.serandour ,

We recently upgraded sonar server from 9.9 to 2025.1 and sonar plugin from 5.1.0.4882 to 6.1.0. While using 5.1.0.4882 (by setting the log level as mentioned above) , we could run Gradle in default mode (logging at lifecycle) and get debug logs of the sonar process.
However after the upgrade, I am unable to set the loglevel exclusively for the sonar-scanner and hence I need to run the gradle build in debug mode.

Alternatively can you help me understand what does sonar-scanner-gradle/src/main/java/org/sonarqube/gradle/SonarTask.java at master · SonarSource/sonar-scanner-gradle · GitHub do the in the latest release of the sonar gradle plugin.

I was unable to use it to achieve what the documentation states.

 This can be used to specify the level of Sonar Scanner which it output during standard task
 execution, without needing to override the log level for the full Gradle execution.

Hi @erwan.serandour

Just checking in if you would have any updates on this.
Thanks

Hi @sonardroid,
Sorry, I didn’t see your answer. I’ll investigate more on Friday.

Hi @sonardroid,

Thank you for reporting the issue, I was able to reproduce it and I have created a ticket to fix it. For now, I don’t think there is an easy way to solve the problem.

1 Like

Hi @erwan.serandour

Thanks for the update. To understand this further (since the ticket details did not clarify this). Would this logging be supported on the new version or would it be removed?

Hi @sonardroid,

Yes, it is not clear in the ticket. I think it is a valuable feature, I have updated the ticket to make clear that the goal is to support it.