Allow finer log level settings
Current situation
Java services do not take into account the DEBUG_LEVEL environment variable to define the display level of their logs. Only INFO level logs are displayed.
Desired outcome
The DEBUG_LEVEL
environment variable can increase or decrease the log details.
Possible values would be:
Name | Description |
---|---|
CRITICAL |
Only critical messages are shown |
ERROR |
Only errors and above (CRITICAL) messages are shown |
WARNING |
Warnings, errors, and critical messages are shown |
INFO |
Info, warnings, errors, and critical messages are shown |
DEBUG |
Debug, info, warnings, erros, and critical messages are shown |
NOTSET |
All messages are shown (including traces if available |
The default would be INFO
or WARNING
.
Solution
We need a script that checks the value of the environment variable and injects that value into the log arguments (-Dlogging.level.org.squashtest.tf2=debug -Dlogging.level.web=DEBUG -Dlogging. level.org.opentestfactory=DEBUG") of the Java service launch command.
NB: The Java Logback logger does not have a CRITICAL level. When the DEBUG_LEVEL environment variable is set to CRITICAL the Java services logger is set to ERROR.
Related to: java-toolkit#45 (closed)