logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "billokara@gmail.com"<billok...@gmail.com>
Subject issues with log4j-web.jar deployed location
Date Wed, 27 Sep 2017 21:04:24 GMT
Hi,

should log4j-web.jar be packaged in individual web app WEB-INF/lib or can it be deployed in
tomcat/lib (to be shared by several web apps)?

Tested with log4j2 v2.6 and latest v2.9.1, and noticed that it seems to work either way when
a webapp is first deployed. BUT if having a log4j2.xml configured like:

<Configuration monitorInterval="10" status="warn" verbose="true">
    <Appenders>
        <File name="APP_LOGFILE" fileName="logs/${web:contextPath}.log"/>
    </Appenders>


when the webapp, say, MyApp is loaded, it will correctly use the web:contextPath lookup and
create a MyApp.log file. But after modifying the log4j2.xml log level, the configuration will
get reloaded as expected, BUT then instead of logging to the original MyApp.log file, it will
create a 
${web:contextPath}.log 
file and logging to that new file.

That problem only happens if the log4j2-web.jar file is put in tomcat/lib, instead of packaged
in MyApp/WEB-INF/lib

So just want to confirm if log4j-web.jar should always be packaged in WEB-INF/lib?


thanks!
Bill



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message