Turn off console logging (sonar.log.level)

  • SQ version 8.5.0.37579
  • For certain pipeline builds, we would like to suppress the console logs, such that we just get back an exit code for a successful scan.
  • We looked at the ‘Analysis Parameters’ listed here (Analysis Parameters | SonarQube Docs) and the ‘sonar.log.level’ does not seem to have the option to be turned off. Is that option available, or would there be a different parameter that we could use to turn those console logs off.
1 Like

Hello @alyman,

The is no way to turn off logging except for DEBUG and TRACE levels. If you don’t want logging (and I would wonder why, this is useful for investigation at least), you have to redirect output to a black hole output such as /dev/null

Olivier

I see the need for it. In my project 3/4 of the logging is occupied with log lines where I don’t see the need for, this results in 14.000 lines cluttering up my log and make it harder to pinpoint the root cause for a failing build. What am I doing wrong here?

example part of my log file (some names as obfuscated):

INFO: Parsing D:\Jenkins\workspace\my_bosch_project\build\my_variant\Unit_Tests\Coverage\abstraction_layer_mock.cpp.gcda##abstraction_layer_mock.cpp.gcov
WARN: File not analysed by Sonar, so ignoring coverage: D:\Jenkins\workspace\my_bosch_project\build\my_variant\Unit_Tests\Coverage\..\..\..\..\03_Modules\Abstraction_layer\test\src\mock\abstraction_layer_mock.cpp
INFO: Parsing D:\Jenkins\workspace\my_bosch_project\build\my_variant\Unit_Tests\Coverage\abstraction_layer_mock.cpp.gcda##aligned_buffer.h.gcov
WARN: File not analysed by Sonar, so ignoring coverage: C:\Conda3_64\envs\699b185e27b9b585a4759856cef83590\Library\lib\gcc\i686-w64-mingw32\8.1.0\include\c++\ext\aligned_buffer.h
INFO: Parsing D:\Jenkins\workspace\my_bosch_project\build\my_variant\Unit_Tests\Coverage\abstraction_layer_mock.cpp.gcda##allocator.h.gcov
WARN: File not analysed by Sonar, so ignoring coverage: C:\Conda3_64\envs\699b185e27b9b585a4759856cef83590\Library\lib\gcc\i686-w64-mingw32\8.1.0\include\c++\bits\allocator.h
INFO: Parsing D:\Jenkins\workspace\my_bosch_project\build\my_variant\Unit_Tests\Coverage\abstraction_layer_mock.cpp.gcda##alloc_traits.h.gcov
WARN: File not analysed by Sonar, so ignoring coverage: C:\Conda3_64\envs\699b185e27b9b585a4759856cef83590\Library\lib\gcc\i686-w64-mingw32\8.1.0\include\c++\ext\alloc_traits.h
INFO: Parsing D:\Jenkins\workspace\my_bosch_project\build\my_variant\Unit_Tests\Coverage\abstraction_layer_mock.cpp.gcda##atomicity.h.gcov
WARN: File not analysed by Sonar, so ignoring coverage: C:\Conda3_64\envs\699b185e27b9b585a4759856cef83590\Library\lib\gcc\i686-w64-mingw32\8.1.0\include\c++\ext\atomicity.h
INFO: Parsing D:\Jenkins\workspace\my_bosch_project\build\my_variant\Unit_Tests\Coverage\abstraction_layer_mock.cpp.gcda##basic_ios.h.gcov
WARN: File not analysed by Sonar, so ignoring coverage: C:\Conda3_64\envs\699b185e27b9b585a4759856cef83590\Library\lib\gcc\i686-w64-mingw32\8.1.0\include\c++\bits\basic_ios.h
INFO: Parsing D:\Jenkins\workspace\my_bosch_project\build\my_variant\Unit_Tests\Coverage\abstraction_layer_mock.cpp.gcda##basic_string.h.gcov
WARN: File not analysed by Sonar, so ignoring coverage: C:\Conda3_64\envs\699b185e27b9b585a4759856cef83590\Library\lib\gcc\i686-w64-mingw32\8.1.0\include\c++\bits\basic_string.h
INFO: Parsing D:\Jenkins\workspace\my_bosch_project\build\my_variant\Unit_Tests\Coverage\abstraction_layer_mock.cpp.gcda##basic_string.tcc.gcov
WARN: File not analysed by Sonar, so ignoring coverage: C:\Conda3_64\envs\699b185e27b9b585a4759856cef83590\Library\lib\gcc\i686-w64-mingw32\8.1.0\include\c++\bits\basic_string.tcc
INFO: Parsing D:\Jenkins\workspace\my_bosch_project\build\my_variant\Unit_Tests\Coverage\abstraction_layer_mock.cpp.gcda##c++locale.h.gcov
WARN: File not analysed by Sonar, so ignoring coverage: C:\Conda3_64\envs\699b185e27b9b585a4759856cef83590\Library\lib\gcc\i686-w64-mingw32\8.1.0\include\c++\i686-w64-mingw32\bits\c++locale.h
INFO: Parsing D:\Jenkins\workspace\my_bosch_project\build\my_variant\Unit_Tests\Coverage\abstraction_layer_mock.cpp.gcda##char_traits.h.gcov
WARN: File not analysed by Sonar, so ignoring coverage: C:\Conda3_64\envs\699b185e27b9b585a4759856cef83590\Library\lib\gcc\i686-w64-mingw32\8.1.0\include\c++\bits\char_traits.h
INFO: Parsing D:\Jenkins\workspace\my_bosch_project\build\my_variant\Unit_Tests\Coverage\abstraction_layer_mock.cpp.gcda##cmath.gcov
WARN: File not analysed by Sonar, so ignoring coverage: C:\Conda3_64\envs\699b185e27b9b585a4759856cef83590\Library\lib\gcc\i686-w64-mingw32\8.1.0\include\c++\cmath
INFO: Parsing D:\Jenkins\workspace\my_bosch_project\build\my_variant\Unit_Tests\Coverage\abstraction_layer_mock.cpp.gcda##codecvt.h.gcov
WARN: File not analysed by Sonar, so ignoring coverage: C:\Conda3_64\envs\699b185e27b9b585a4759856cef83590\Library\lib\gcc\i686-w64-mingw32\8.1.0\include\c++\bits\codecvt.h
INFO: Parsing D:\Jenkins\workspace\my_bosch_project\build\my_variant\Unit_Tests\Coverage\abstraction_layer_mock.cpp.gcda##cpp_type_traits.h.gcov
WARN: File not analysed by Sonar, so ignoring coverage: C:\Conda3_64\envs\699b185e27b9b585a4759856cef83590\Library\lib\gcc\i686-w64-mingw32\8.1.0\include\c++\bits\cpp_type_traits.h
INFO: Parsing D:\Jenkins\workspace\my_bosch_project\build\my_variant\Unit_Tests\Coverage\abstraction_layer_mock.cpp.gcda##cstdlib.gcov
WARN: File not analysed by Sonar, so ignoring coverage: C:\Conda3_64\envs\699b185e27b9b585a4759856cef83590\Library\lib\gcc\i686-w64-mingw32\8.1.0\include\c++\cstdlib
INFO: Parsing D:\Jenkins\workspace\my_bosch_project\build\my_variant\Unit_Tests\Coverage\abstraction_layer_mock.cpp.gcda##ctype_inline.h.gcov
WARN: File not analysed by Sonar, so ignoring coverage: C:\Conda3_64\envs\699b185e27b9b585a4759856cef83590\Library\lib\gcc\i686-w64-mingw32\8.1.0\include\c++\i686-w64-mingw32\bits\ctype_inline.h
INFO: Parsing D:\Jenkins\workspace\my_bosch_project\build\my_variant\Unit_Tests\Coverage\abstraction_layer_mock.cpp.gcda##cwchar.gcov
WARN: File not analysed by Sonar, so ignoring coverage: C:\Conda3_64\envs\699b185e27b9b585a4759856cef83590\Library\lib\gcc\i686-w64-mingw32\8.1.0\include\c++\cwchar
INFO: Parsing D:\Jenkins\workspace\my_bosch_project\build\my_variant\Unit_Tests\Coverage\abstraction_layer_mock.cpp.gcda##cxxabi.h.gcov
WARN: File not analysed by Sonar, so ignoring coverage: C:\Conda3_64\envs\699b185e27b9b585a4759856cef83590\Library\lib\gcc\i686-w64-mingw32\8.1.0\include\c++\cxxabi.h
INFO: Parsing D:\Jenkins\workspace\my_bosch_project\build\my_variant\Unit_Tests\Coverage\abstraction_layer_mock.cpp.gcda##exception.gcov
WARN: File not analysed by Sonar, so ignoring coverage: C:\Conda3_64\envs\699b185e27b9b585a4759856cef83590\Library\lib\gcc\i686-w64-mingw32\8.1.0\include\c++\exception
INFO: Parsing D:\Jenkins\workspace\my_bosch_project\build\my_variant\Unit_Tests\Coverage\abstraction_layer_mock.cpp.gcda##exception.h.gcov
WARN: File not analysed by Sonar, so ignoring coverage: C:\Conda3_64\envs\699b185e27b9b585a4759856cef83590\Library\lib\gcc\i686-w64-mingw32\8.1.0\include\c++\bits\exception.h
INFO: Parsing D:\Jenkins\workspace\my_bosch_project\build\my_variant\Unit_Tests\Coverage\abstraction_layer_mock.cpp.gcda##exception_ptr.h.gcov
WARN: File not analysed by Sonar, so ignoring coverage: C:\Conda3_64\envs\699b185e27b9b585a4759856cef83590\Library\lib\gcc\i686-w64-mingw32\8.1.0\include\c++\bits\exception_ptr.h
INFO: Parsing D:\Jenkins\workspace\my_bosch_project\build\my_variant\Unit_Tests\Coverage\abstraction_layer_mock.cpp.gcda##functional_hash.h.gcov
WARN: File not analysed by Sonar, so ignoring coverage: C:\Conda3_64\envs\699b185e27b9b585a4759856cef83590\Library\lib\gcc\i686-w64-mingw32\8.1.0\include\c++\bits\functional_hash.h
INFO: Parsing D:\Jenkins\workspace\my_bosch_project\build\my_variant\Unit_Tests\Coverage\abstraction_layer_mock.cpp.gcda##gmock-actions.h.gcov