Hi,

in my application, I want to programmatically add a log appender. The
org.ops4j.pax.logging.cfg file should be left untouched (meaning that I
don't want to use ConfigAdmin to change the configuration).

When trying with the log4j ConfigurationBuilder to configure the appender
and the logger, and then the Configurator to activate it, following error
appears:

/LogManager returned an instance of
org.ops4j.pax.logging.log4jv2.Log4jv2LoggerContextFactory which does not
implement org.apache.logging.log4j.core.impl.Log4jContextFactory. Unable to
initialize Log4j/.

My pom contains the pax-logging-api and pax-logging-log4j2 bundles as
dependencyies, both with version 1.10.1.

Is there a way to get this right, or another way to create a log appender
via code? Please note that I don't want to create a custom appender, just
configure a rolling file appender, but from code instead of from config
file.

Best Regards

Jochen



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Reply via email to