
I'm currently migrating our internal project from log4j to sl4fj/logback, and so far have been having pretty good results. Because we have multitple web-apps running under tomcat, I'm using the JNDI context selectors as described at http://logback.qos.ch/manual/contextSelector.html . The problem I am having is that I wish to be able to set a system property at runtime to describe to set the directory for logging destination to the WEB-INF/logs folder of the application. So I am setting a system property of appname.log.home to ..../appname/WEB-INF/logs, and then referring to it in the jndi-specifc logback.xml as ${appname.log.home to }/cc.log. Very similar to the InitContextListener in the log4j sandbox. However, I don't believe the system property is being set in time. How can I tell the Context to reload itself, so the system property can then be read? The reason for all of this is so that the default configuration for development purposes puts the logs into the WEB-INF directory, but so that I can take the same WAR, move it to production, modifying the the environment variable logback/configuration-resource for the application to point to a separate logback.xml file Anyone have any ideas? Should I scrap the JNDI contexts and just use the JoranConfigurator to reload the config in a ServletContextListener? Thanks, Greg Case