I'm pretty much a JEE/Jakarta illiterate, but have you checked the Integrating
with Jakarta EE <https://logging.apache.org/log4j/2.x/jakarta.html> page?

On Tue, Jan 27, 2026 at 11:01 AM Christopher Dodunski <
[email protected]> wrote:

> Dear Log4J2 community,
>
> I am currently exploring the possibility of deploying multiple (byte
> identical) WARs for servicing multiple tenants, but hosted by a single
> Tomcat installation.
>
> The WARs, although being identical (including web.xml), are to be named
> according to each tenant.  My main goal is having these web applications
> logging to different files.
>
>      tom.war >> /tom (Tomcat context) >> logs to tom.log
>
>      dick.war >> /dick >> logs to dick.log
>
>      harry.war >> /harry >> logs to harry.log
>
> I've created separate log4j2.xml configuration files for each and placed
> these in WEB-INF, as per below:
>
>      WEB-INF/log4j2-tom.xml
>
>      WEB-INF/log4j2-dick.xml
>
>      WEB-INF/log4j2-harry.xml
>
> I'd thought that the log4j-web package would allow Log4J to
> automatically select the correct XML based on Tomcat context, but this
> seems not to be the case.
>
> I'm eager to learn of a method that would allow log filenames to be set
> from outside the WAR, if possible.
>
> Thanking you in advance for any suggestions.
>
> Kind regards,
>
> Chris.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to