[logback-user] auto context name creation

Ingo Siebert ingo.siebert at cas.de
Wed Jan 30 10:40:38 CET 2008

Hi Anders,

thanks for your answer. I implemented this but it doesn't help in any case.

In my case, it happens that the same application version is deployed 
twice. If one of the application versions is undeployed, the other one 
misses the JNDI/LOG configuration.


Anders Hammar schrieb:
> Hi,
> As I see it there are probably numerous ways this can be done and it has
> nothing to do with logback. If you're using ant, the easiest way would
> probably be to use a token in the web.xml file that is replaced during the
> build process. The token would then be replaced (through the ant filter
> task) with, for instance, myApp22012008 or myApp23012008 depending on the
> build.
> More info:
> http://ant.apache.org/manual/CoreTasks/filter.html
> Hope it helps,
> /Anders
> Ingo Siebert wrote:
>> Hi,
>> i switched to logback because it sounds promising.
>> I have an web appplication (Tomcat6) which can be deployed more than once.
>> In the FAQ i've read this to get a context-based logging.
>> <env-entry>
>>    <description>JNDI logging context for this app</description>
>>    <env-entry-name>logback/context-name</env-entry-name>
>>    <env-entry-type>java.lang.String</env-entry-type>
>>    <env-entry-value>ContextApp-A</env-entry-value>
>> </env-entry>
>> Is it possible to auto-create a different "ContextApp-A" value?
>> Reason: I want to deploy nearly the same WAR under different names at 
>> the same time. Example: myApp22012008.war and myApp23012008.war
>> Cheers,
>> Ingo
>> _______________________________________________
>> Logback-user mailing list
>> Logback-user at qos.ch
>> http://qos.ch/mailman/listinfo/logback-user

More information about the Logback-user mailing list