[logback-user] Logback config from Tomcat - always a static resource, never a scannable file?

jakartaman jakartaman at m-plify.net
Thu Oct 27 08:53:53 CEST 2011


Hi,

I have checked out how to configure logback for Tomcat webapps (as 
described in http://logback.qos.ch/manual/contextSelector.html).

At one point, one configures the name of the XML config file, like so:

<env-entry>
<description>URL for configuring logback context</description>
<env-entry-name>logback/configuration-resource</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>logback-app-A.xml</env-entry-value>
</env-entry>


Unfortunately, the manual suggests (and code inspection confirms) that 
the XML config file is indeed always a resource on the classpath, never 
a file on the filesystem.

This means the nifty "scan" facility cannot be used in the webapp, as 
scanning a classpath resource is not exactly fruitful.

Before I start adding some code, is there some known way to make the 
webapp aware of changing XML config files?

-- David




More information about the Logback-user mailing list