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.
Asked
Active
Viewed 214 times
1 Answers
0
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.

Christian Schneider
- 19,420
- 2
- 39
- 64
-
can I use this to have two properties files? – Asma Zinneera Jabir Jul 19 '17 at 07:11
-
No. You can only have one configuration for the logging. How would it make sense to have two? – Christian Schneider Jul 19 '17 at 07:45