I have recently migrated our OSGi bundles to JAVA 11 and also updating the Eclipse OSGi bundles in the process (Photon Release). However, the LogService itself seems to be behaving a bit odd as previously we could log our messages with the log level specified which worked perfectly. However, the log level seems to be ignored now and we are only able to see ERROR-related messages. For convinience, following is the code I am using to test the log service;
ServiceTracker logServiceTracker = new ServiceTracker<>(context,LoggerFactory.class.getName(),null);
logServiceTracker.open();
LoggerFactory factory = (LoggerFactory) logServiceTracker.getService();
if(factory != null) {
logger = factory.getLogger(Activator.class);
if(logger != null) {
if(logger.isInfoEnabled()) {
logger.info("INFO Enabled");
}
if(logger.isErrorEnabled()) {
logger.error("ERROR Enabled");
}
if(logger.isWarnEnabled()) {
logger.warn("WARN Enabled");
}
if(logger.isDebugEnabled()) {
logger.debug("DEBUG Enabled");
}
}
Debugging shows that Log level has been set to 'WARN'. I tried setting the log level in the config.ini (eclipse.log.level) but that has no effect. Any hint(s) or help will be appreciated. Thank you!