0

There is an maven OSGI component in which I have a call to EclipseStarter.stop() statement which shuts down the OSGI framework. There are a couple of log statements printed after this line. I have used pax-logging with log4j2 as the logging backend and JCL at the frontend.

Since OSGI framework is down the log messages do not print through pax-logging-log4j2. Therefore I am trying to use java util logging to print these messages. The logger initialization in the java file is done as follows.

private static final Log log = LogFactory.getLog(MyClass.class);
private static final Logger logger = Logger.getLogger(MyClass.class.getName());

log.info("Before shutdown");

EclipseStarter.stop();

logger.log(Level.INFO, "After shutdown JUL");    
log.info("After shutdown JCL");

The util logging statement seems to be skipping when I debugged.

Asma Zinneera Jabir
  • 801
  • 3
  • 13
  • 31

1 Answers1

0

In order to see output from a logger you have to attach a Handler subclass. You can add them from code or you can create a logging.properties.

jmehrens
  • 10,580
  • 1
  • 38
  • 47