TomEE and log4j2


Since few weeks TomEE has some support for log4j2 without using log4j2-log4j compatibility module.

To set it up just add the log4j2 jars you want to tomee (lib/) and add your config – log4j2.xml – in the classloader (lib/ works too).

Side note: you can do it using a conf/jars.txt file and using log4j2 maven coordinates, really more easy ;).

Then in conf/system.properties (or in CATALINA_OPTS) set the system property openejb.log.factory to log4j2:

openejb.log.factory=log4j2

Then you’ll get the container logs redirected to log4j2.

2 thoughts on “TomEE and log4j2

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s