I have this conf in my logback.xml:
<logger name="L1" additivity="false">
<appender-ref ref="${SELECTED_CONSOLE}" />
</logger>
<root level="${LOG_LEVEL}">
<appender-ref ref="${SELECTED_CONSOLE}" />
</root>
My issue is, on some env, if the LOG_LEVEL var hasn't been defined, what will the level of log of L1 be?
If the LOG_LEVEL
parameter is undefined then Logback will treat that as this string:
LOG_LEVEL_IS_UNDEFINED
Logback will then turn that value into ch.qos.logback.classic.Level.DEBUG
(see the implementation of ch.qos.logback.classic.Level.toLevel()
)
So, your root logger level will be DEBUG
and since the L1 logger has no level declared it will inherit that level. So, if LOG_LEVEL
is not defined then the log level for L1 will be: DEBUG
.
The fact that L1's additivity is false does not change this; additivity prevents parents of the L1 logger from using their appenders to display the message, it does not affect the inferred log level.