karaf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernhard Schuhmann <bernhard.schuhm...@gmx.de>
Subject Re: Error while installing log4j2 api on Karaf
Date Sat, 11 Apr 2015 20:40:24 GMT

in case you haven't figured it out in the meantime yourself - Pax Logging
has a separate implementation for the logging service that uses Log4j v2
instead of v1. The implementation is in another bundle pax-logging-log4j2,
the implementation that uses v1 is pax-logging-service. pax-logging-log4j2
re-exports the log4j2 packages.

To get log4j2 working in Karaf, I've changed the Pax logging service bundle
in etc/startup.properties:

The log4j2 service implementation uses the same Config Admin pid, instead of
log4j v1 settings it just contains a reference to the log4j2.xml file.
Change etc/org.ops4j.pax.logging.cfg to

Setting the log level is optional 

To use system properties in log4j's config file, just use the sys: prefix

Finally you need to configure the appender from Pax Logging inside log4j's
config xml file (e.g. etc/log4j2.xml) with

Choose the appender name you like, but Pax Logging registers its service
with the name VmLogAppender.

View this message in context: http://karaf.922171.n3.nabble.com/Error-while-installing-log4j2-api-on-Karaf-tp4038875p4039566.html
Sent from the Karaf - Dev mailing list archive at Nabble.com.

View raw message