Details
-
Bug
-
Resolution: Unresolved
-
Major
-
1.2.3
-
None
-
Linux Fedora 32, java 8, command-line app with loggers displaying on console
Description
I have a java application that is run from the command line. I have my logback.xml file configured to display all messages on the console.
In my logback.xml file, I have configured my logger like this:
{{ <logger name="com.ibm.sdk.codegen" level="${SDKGEN_LOGLEVEL:-INFO}">}}
<appender-ref ref="STDOUT"/>
<appender-ref ref="STDERR"/>
{{ </logger>}}
I want the default log level to be INFO, but I also would like to allow users to specify "-DSDKGEN_LOGLEVEL=DEBUG" as part of the java command to enable debug logging.
I'm following these instructions on how to do this, but I can't seem to get this to work. I have some debugging code in my application that verifies the system property is being set as expected:
[INFO ] c.i.s.c.IBMDefaultCodegen: SDKGEN_LOGLEVEL=DEBUG this.class=IBMJavaCodegen
But logback-classic seems to not want to use that system property value. What am i doing wrong?
I'll attach my full logback.xml file to this issue for reference.