Reputation: 3183
In command line, I can run a java file like:
java -Dlogback.configurationFile=logback.xml -jar floodlight.jar
But in OSGi container like FUSE ESB, I cannot add such
-Dlogback.configurationFile=logback.xml
How can I do the same thing when use osgi container?
Upvotes: 0
Views: 907
Reputation: 455
You should be able to add all system properties to the etc/system.properties
file.
So in your case you might try to append:
logback.configurationFile=logback.xml
or if this is not working and you have placed the file in the etc directory:
logback.configurationFile=${karaf.home}/etc/logback.xml
Note that this is not a *.cfg
file and therefore is not covered by the config admin and might require a restart.
Upvotes: 1
Reputation: 341
Fuse ESB have Pax Logging service which supports logback API. You could specify your logback configuration file location in the Pax Logging configuration file. Just add org.ops4j.pax.logging.logback.config.file=<PATH_TO_LOGBACK_FILE>/logback.xml
to the etc/org.ops4j.pax.logging.cfg
file.
Upvotes: 0