using pax-logging properties file in classpath

252 Views Asked by At

I am using pax-logging with log4j2 and have custom appenders written in OSGi environemt. When I give the pax-logging properties file as a system property, the custom appenders are not read. Is there a way to use pax-logging in the classpath like log4j2 uses its property file? Any alternatives please.

1

There are 1 best solutions below

2
On

You should provide the pax-logging config using config admin. To do this install felix fileinstall and config admin bundles and provide the org.ops4j.pax.logging.cfg in the directory where the logs are read from.

For custom appenders a good approach is to offer them as OSGi services. An example for this is the karaf decanter log collector which uses this approach.