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.

CDI and ApplicationComposer: finally easy to test deltaspike with AppComposer


OpenEJB/TomEE ApplicationComposer design is to describe a test application with an in memory model close to the xml EE one (Beans for beans.xml, EjbJar for ejb-jar.xml…).

But when it comes to CDI and since it was mainly designed for small apps it is hard to say “I have a CDI dependency/library”.

The more obvious use case is DeltaSpike!

To make it easier we added @Jars recently.

Continue reading