简体   繁体   中英

Print System.out.println in log file of Apache Karaf

I have an OSGi Jar file which I am deploying on Apache Karaf. The underlining code has system.out.println statements but I am not able to view them in the Apache Karaf log file. I see that my bundle is active.

Is there any property which I can set to enable it?

I am new to OSGi and Karaf.

The log file only contains what you sent through one of the logging APIs. Karaf uses pax-logging . So the logging APIs available are log4j, sl4fj, commons logging and some others.

Anything sent to System.out will go to the local console but not the log.

The log4j logging configuration is placed in {karaf.home}/etc/org.ops4j.pax.logging.cfg file.

You should prepare configuration like this: https://stackoverflow.com/a/5743102/5898010

Good luck

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM