1

I'm using pax-logging in one of a OSGi project. I want to set a system property to the value of org.ops4j.pax.logging.log4j2.config.file which is mentioned in the pax-logging.properties file. Is this possible? I've seen that in Karaf they use ${karaf.base}/somepath. But when I used in a similar manner

e.g. ${custom.home}/conf/log4j2.xml

Full file

org.ops4j.pax.logging.log4j2.config.file=${custom.home}/conf/log4j2.xml

it doesn't resolve the custom.home property instead use that as a string.

  • You have to start your java with the JAVA_OPTS: `-Dcustom.home=your.value` and it should work. The karaf.base variable is set by karaf script and take the KARAF_BASE environment variable ( `-Dkaraf.base="${KARAF_BASE}" \` from the [source code](https://github.com/apache/karaf/blob/5144a1eba5687dab0f016a9bf95e58e6687a26ad/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf) – рüффп Jan 24 '22 at 22:21

0 Answers0