You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "Heck, Timo" <T....@dnb.de> on 2013/06/14 15:36:27 UTC

Substitute webapp display-name in XMLConfiguration

Hi there,

we are currently looking for a logging solution for our tomcat6 environment.
We are running multiple webapps on one server.

The idea is to use a generic configuration to deploy with all applications.
Our current problem is that we would like to deploy a webapp and
have the log file be named after the webapps display name.

I learned that I am able to configure a separate LoggerContext for
every webapp by declaring Log4jContextListener in web.xml.
While documentation states that the LoggerContext is named after
the webapp display-name I assumed I would be able to reference this value in log4j2.xml
with ${contextName}.

Well, I figured I was wrong about the value of contextName.
Still I think this would be a good idea. Or the display-name
could be added to propertiesMap.

Is it possible to achieve this somehow?



***Lesen. Hören. Wissen. Deutsche Nationalbibliothek***
--
Timo Heck 
Deutsche Nationalbibliothek 
Informationstechnik 
Adickesallee 1 
D-60322 Frankfurt am Main 
Tel.: +49-69-1525-1792 
Fax: +49-69-1525-1799 
mailto:t.heck@dnb.de 
http://www.dnb.de