SiftingAppender lose dynamic configuration in Web application in EAR

Hello, For a project I am using a SiftingAppender on top of a RollingFileAppender defined in a logback.xml. <appender name="SIFT" class="ch.qos.logback.classic.sift.SiftingAppender"> <discriminator class="ch.qos.logback.classic.sift.JNDIBasedContextDiscriminator"> ... </discriminator> <sift> <appender name="FILE-${contextName}" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>logs/${contextName}.log</file> ... The logback configuration is shared in an EAR for multiple web applications. I update the RollingFileAppender file value at deployment in a ServletContextListener, replacing the ${contextName} with the context-root of the application being deployed. For instance, Web Application MyWebApp1, configured to log to logs/mywebapp1.log is deployed to /ContextA/MyWebApp1. So Iupdate logs/mywebapp1.log to logs/contexta_mywebapp1.log. It should be just the ServletContextListener logging to the initial file. My issue is that it occurs that the application /ContextA/MyWebApp1 switch back to logs/mywebapp1.log. It seems the programmatic configuration I did at deployment is lost. My question is, finally :), is there a way for logback to detect configuration loss and launch programmatic reconfiguration ? Thanks, David
participants (1)
-
Béziat