On 30/05/2011 3:10 PM, Nathaniel Auvil wrote:
I want to deploy multiple applications in Tomcat. Each one will include
Logback jars. I need to have the log configuration file external to the
war so i can change them on the fly.  Is the "best" way to do this to
have an init servlet in each application which loads from the
filesystem?  I can pass a system property on Tomcat startup which points
to a "config" directory.

Hello Nathaniel,

You could include an external configuration file on a path dependent on the application. Example:

-- contents of logback.xml shipping within myApp1, one of your web-apps

<configuration scan="true">
  <include file="/a/path/myApp1/logback.xml"/>
</configuration>

Auto scan feature is documented at
  http://logback.qos.ch/manual/configuration.html#autoScan

-- contents of /a/path/myApp1/logback.xml

<included>
  ... other content
</included>

File inclusion is documented at
 http://logback.qos.ch/manual/configuration.html#fileInclusion

Note that logback will scan for changes in included files as well.

HTH,

--
QOS.ch, main sponsor of cal10n, logback and slf4j open source projects, is looking to hire talented software developers. For further details, see http://logback.qos.ch/job.html
_______________________________________________
Logback-user mailing list
[email protected]
http://qos.ch/mailman/listinfo/logback-user

Reply via email to