Thanks Piotr. He opted for and tested: "move the `log4j2.component.properties` into the shared classloader"works fine in both envmts.
Arbi Sookazian | Sr Software Engineer | Medata, Inc. 5 Peters Canyon Road, Suite 250 Irvine, CA 92606 asookaz...@medata.com | www.medata.com ----- Original Message ----- From: Piotr P. Karwasz <pi...@mailing.copernik.eu> To: log4j-user@logging.apache.org Sent: Wed, 30 Apr 2025 02:13:31 -0700 (PDT) Subject: Re: Unable to config/init logging separation for web app on Tomcat 7.0.82 Hi Arbi, On 29.04.2025 21:22, Arbi Sookazian wrote: > Strike my previous comment regarding testing1 (it's not configured for > separate logging and is likely logging to catalina.out).Any possible reasons > why potentially log4j2.component.properties is not being scanned or fail to > read key/value pairs in WEB-INF/classes dir? Does it depend on the deployment > folder hierarchical structure? This is exploded app like my dev envmt. thanks. As far as I understand your `log4j2.component.properties` file is in the `WEB-INF/classes` folder of an application, while `log4j-api` is in a classloader shared by all applications. Older version of Log4j API used the thread context classloader to load resources, this means that * if Log4j API is initialized while your application is active, it will read the `log4j2.component.properties` file. * if Log4j API is initialized while *another* application is active, it will not find it. The QA server certainly has more applications running, than your dev machine, so the second case occurs more often. To prevent this from happening I would either move the `log4j2.component.properties` into the shared classloader or add the properties to `$CATALINA_BASE/conf/catalina.properties`. Piotr --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org