Hi,I have been able to successfully configure and log separately for multiple 
web apps deployed to same Tomcat 7.0.84 container in dev environment (Windows 
11 w/ cygwin).  Now trying to do the same testing in QA environment with Tomcat 
7.0.82 (Linux) and having issue below at startup.  I doubt it has anything to 
do with differing OS.  Please advise what is wrong or is it possibly a JAR 
mismatch in $CATALINA_HOME/shared dir wrt log4j-*.jar files or slf4j-*.jar 
files between the two environments.  log4j-web-2.9.1.jar is in shared dir.  
Thanks.INFO: Deploying web application directory 
/opt/apache/testing-apache-tomcat-7.0.82/webapps/testing2DEBUG StatusLogger 
Log4jServletContextListener ensuring that Log4j starts up properly.
DEBUG StatusLogger getConfigURI found resource 
[jndi:/localhost/testing2/WEB-INF/classes/log4j2.xml] in servletContext at 
[./WEB-INF/classes/log4j2.xml]
WARN StatusLogger Potential problem: Selector is not an instance of 
NamedContextSelector.
We have double checked the configs in web.xml and the log4j2.xml as well as 
log4j2.component.properties.  Everything looks correct/expected in the QA setup.
Contents of log4j2.component.properties:log4j2.enableJndiContextSelector=true
Log4jContextSelector=org.apache.logging.log4j.core.selector.JndiContextSelectorContents
 of web.xml added snippet (added above <listener> section):<context-param>
 <param-name>isLog4jAutoInitializationDisabled</param-name>
 <param-value>true</param-value>
</context-param>
<context-param>
 <param-name>isLog4jContextSelectorNamed</param-name>
 <param-value>true</param-value>
</context-param>
<context-param>
 <param-name>log4jContextName</param-name>
 <param-value>testing2</param-value>
</context-param>
<context-param>
 <param-name>log4jConfiguration</param-name>
 <param-value>./WEB-INF/classes/log4j2.xml</param-value>
</context-param>

<env-entry>
 <env-entry-name>log4j/context-name</env-entry-name>
 <env-entry-value>testing2</env-entry-value>
 <env-entry-type>java.lang.String</env-entry-type>
</env-entry>

<listener>
 
<listener-class>org.apache.logging.log4j.web.Log4jServletContextListener</listener-class>
</listener>
<filter>
 <filter-name>log4jServletFilter</filter-name>
 <filter-class>org.apache.logging.log4j.web.Log4jServletFilter</filter-class>
</filter>
<filter-mapping>
 <filter-name>log4jServletFilter</filter-name>
 <url-pattern>/*</url-pattern>
 <dispatcher>REQUEST</dispatcher>
 <dispatcher>FORWARD</dispatcher>
 <dispatcher>INCLUDE</dispatcher>
 <dispatcher>ERROR</dispatcher>
</filter-mapping>
Arbi Sookazian | Sr Software Engineer | Medata, Inc.
5 Peters Canyon Road, Suite 250
Irvine, CA 92606
asookaz...@medata.com | www.medata.com

Reply via email to