java - multiple logback.xml configuration files for different tomcat war applications -


i'm dealing 2 war applications (let's call them app1.war , app2.war) deployed in tomcat7 environment. through setenv.sh i'm extending classpath shared folder located in /opt/configurations.

i'd structure configurations way: configurations/ ├── app1.properties ├── app2.properties ├── logback-app1.xml └── logback-app2.xml

how tell each application read different logback*.xml files shared classpath? in other words, how tell app1.war read logback-app1.xml , app2.war read logback-app2.xml.

there answer question here : http://vtanase.blogspot.com/2012/07/how-to-create-different-logback.html

the point use different jndi entry declared in each web.xml

<env-entry>   <env-entry-name>logback/configuration-resource</env-entry-name>   <env-entry-type>java.lang.string</env-entry-type>   <env-entry-value>app1/logback.xml</env-entry-value> </env-entry> 

and add property logback jndi :

java_opts="$java_opts -dlogback.contextselector=jndi" 

if problem separate resulting logging file each war, there other way achieve 1 single logback.xml using siftingappender. examples can found :


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -