0

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.

Spandan Thakur
  • 338
  • 2
  • 14

2 Answers2

2

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.

Christian Schneider
  • 19,420
  • 2
  • 39
  • 64
1

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

Community
  • 1
  • 1
Pawel
  • 61
  • 5