summaryrefslogtreecommitdiffstats
path: root/container-core
diff options
context:
space:
mode:
authorgjoranv <gv@verizonmedia.com>2019-10-29 11:47:30 +0100
committergjoranv <gv@verizonmedia.com>2019-10-29 13:44:16 +0100
commit205861992d4d65435c3afafac515cb3fda615585 (patch)
tree85fb2c046a75ed8357b9eee49d2a22d3fc8646ca /container-core
parentfb652e337235245740602a6c586a668e98f68993 (diff)
Add debug logging
Diffstat (limited to 'container-core')
-rw-r--r--container-core/src/main/java/com/yahoo/container/core/config/BundleLoader.java1
-rw-r--r--container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java4
2 files changed, 5 insertions, 0 deletions
diff --git a/container-core/src/main/java/com/yahoo/container/core/config/BundleLoader.java b/container-core/src/main/java/com/yahoo/container/core/config/BundleLoader.java
index 18886d2e5a9..9115a51b486 100644
--- a/container-core/src/main/java/com/yahoo/container/core/config/BundleLoader.java
+++ b/container-core/src/main/java/com/yahoo/container/core/config/BundleLoader.java
@@ -174,6 +174,7 @@ public class BundleLoader {
public synchronized Set<Bundle> use(List<FileReference> bundles) {
Set<Bundle> bundlesToUninstall = retainOnly(bundles);
osgi.allowDuplicateBundles(bundlesToUninstall);
+ log.info(() -> bundlesToUninstall.isEmpty() ? "Adding bundles to allowed duplicates: " + bundlesToUninstall : "");
install(bundles);
startBundles();
diff --git a/container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java b/container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java
index 5fa0e65463a..2a308cf1ffd 100644
--- a/container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java
+++ b/container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java
@@ -11,12 +11,14 @@ import org.osgi.framework.launch.Framework;
import java.util.Collection;
import java.util.List;
+import java.util.logging.Logger;
/**
* @author Tony Vaagenes
* @author bratseth
*/
public class OsgiImpl implements Osgi {
+ private static Logger log = Logger.getLogger(OsgiImpl.class.getName());
private final OsgiFramework jdiscOsgi;
@@ -36,6 +38,7 @@ public class OsgiImpl implements Osgi {
alwaysCurrentBundle = firstNonFrameworkBundle(initialBundles);
if (alwaysCurrentBundle == null)
throw new IllegalStateException("The initial bundles only contained the framework bundle!");
+ log.info("Using " + alwaysCurrentBundle + " to lookup current bundles.");
}
@Override
@@ -111,6 +114,7 @@ public class OsgiImpl implements Osgi {
* @return the bundle match having the highest version, or null if there was no matches
*/
public Bundle getBundle(ComponentSpecification id) {
+ log.fine(() -> "Getting bundle for component " + id + ". Set of current bundles: " + getCurrentBundles());
Bundle highestMatch = null;
for (Bundle bundle : getCurrentBundles()) {
assert bundle.getSymbolicName() != null : "ensureHasBundleSymbolicName not called during installation";