How do you enable Debug/Verbose Logging for the .NET Scanner when ran in the Azure DevOps Task?

I’m using the Azure DevOps task SonarCloudAnalyze@3 to run the analysis on a .NET project. I’m looking to enable sonar.verbose=true and sonar.log.level=DEBUG but I can’t seem to find how you do that.

I’ve so far tried setting SONAR_SCANNER_OPTS environment variable to -Dsonar.verbose=true -Dsonar.log.level=DEBUG and then /d:sonar.verbose=true /d:sonar.log.level=DEBUG when I remembered it wasn’t a java project.

I also tried setting the extraProperties property of the SonarCloudPrepare@3 task to:

sonar.verbose=true
-Dsonar.log.level=DEBUG

None of these seem to have impacted the log output of the SonarCloudAnalyze@3 task.
I have the SONAR_DOTNET_SCANNER_VERSION set to 11.0.0.126294

Hi,

The /d: is needed when you pass it in to the SonarScanner for .NET begin command, and the -D when you pass it in to any of the other scanners. In this case, we’ve got a layer in front of the scanner (i.e. the task). Can you try passing in the properties “bare”? I.e. just sonar.verbose=true?

 
Thx,
Ann

1 Like

Thank you, yes this has worked adding only sonar.verbose=true to the extraProperties property of the SonarCloudPrepare@3 task.

I did have above that I’d tried this but also had the -Dsonar.log.level=DEBUG line in too. maybe this has interfered with it or something else in how I added it.

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