Details
-
Bug
-
Resolution: Fixed
-
Major
-
1.4.6
-
None
Description
It seems that in 1.4.x, the resolution of a JNDI variable occurs after the include tag.
My logback.xml uses insertFromJNDI, but the variable is undefined in the include evaluation and only shows as resolved afterword. This configuration worked perfectly in 1.2.x.
<configuration scan="true">
<insertFromJNDI env-entry-name="java:comp/env/appHome" as="appHome" />
<include file="${appHome}/conf/logback-ssorest.xml"/>
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
<resetJUL>true</resetJUL>
</contextListener>
</configuration>
The logback logs show:
11:12:45,716 |-INFO in ch.qos.logback.classic.LoggerContext[default] - This is logback-classic version 1.4.6
11:12:45,727 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
11:12:45,729 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at file:/D:/IDFC/SSORest-3.1-casso/tomcat/webapps/ssorest/WEB-INF/classes/logback.xml
11:12:45,776 |-INFO in ch.qos.logback.core.joran.util.ConfigurationWatchListUtil@354c986c - Adding file:/D:/IDFC/SSORest-3.1-casso/tomcat/bin/appHome_IS_UNDEFINED/conf/logback-ssorest.xml to configuration watch list.
11:12:45,776 |-WARN in ch.qos.logback.core.joran.action.IncludeAction - Failed to open file:/D:/IDFC/SSORest-3.1-casso/tomcat/bin/appHome_IS_UNDEFINED/conf/logback-ssorest.xml
11:12:45,818 |-INFO in ch.qos.logback.classic.model.processor.ConfigurationModelHandler - Registering a new ReconfigureOnChangeTask ReconfigureOnChangeTask(born:1687273965815)
11:12:45,819 |-INFO in ch.qos.logback.classic.model.processor.ConfigurationModelHandler - No 'scanPeriod' specified. Defaulting to 1 minutes
11:12:45,819 |-INFO in ch.qos.logback.classic.model.processor.ConfigurationModelHandler - Will scan for changes in file:/D:/IDFC/SSORest-3.1-casso/tomcat/webapps/ssorest/WEB-INF/classes/logback.xml
11:12:45,819 |-INFO in ch.qos.logback.classic.model.processor.ConfigurationModelHandler - Setting ReconfigureOnChangeTask scanning period to 1 minutes
11:12:45,823 |-INFO in ch.qos.logback.core.model.processor.InsertFromJNDIModelHandler - Setting variable [appHome] to [../..] in [LOCAL] scope
11:12:45,825 |-INFO in ch.qos.logback.classic.model.processor.LoggerContextListenerModelHandler - Adding LoggerContextListener of type [ch.qos.logback.classic.jul.LevelChangePropagator] to the object stack
11:12:45,830 |-INFO in ch.qos.logback.classic.jul.LevelChangePropagator@11f237b3 - Propagating DEBUG level on Logger[ROOT] onto the JUL framework
11:12:45,830 |-INFO in ch.qos.logback.classic.model.processor.LoggerContextListenerModelHandler - Starting LoggerContextListener
11:12:45,831 |-INFO in ch.qos.logback.core.model.processor.DefaultProcessor@1c22aae1 - End of configuration.
11:12:45,832 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@9129682 - Registering current configuration as safe fallback point
Attachments
Issue Links
- relates to (in)
-
LOGBACK-1732 Log file pollution when using the <include> in a conditional block
- Resolved
- relates to (out)
-
LOGBACK-1731 <include> element only seems to be substituting variables which are on scope "system"
- Resolved
- links to