Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.m2e.logback.configuration/src/org/eclipse/m2e')
-rw-r--r--org.eclipse.m2e.logback.configuration/src/org/eclipse/m2e/internal/logging/LogPlugin.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/org.eclipse.m2e.logback.configuration/src/org/eclipse/m2e/internal/logging/LogPlugin.java b/org.eclipse.m2e.logback.configuration/src/org/eclipse/m2e/internal/logging/LogPlugin.java
index e70f1724..1be9a145 100644
--- a/org.eclipse.m2e.logback.configuration/src/org/eclipse/m2e/internal/logging/LogPlugin.java
+++ b/org.eclipse.m2e.logback.configuration/src/org/eclipse/m2e/internal/logging/LogPlugin.java
@@ -26,8 +26,10 @@ import ch.qos.logback.core.joran.spi.JoranException;
import ch.qos.logback.core.util.StatusPrinter;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.service.datalocation.Location;
public class LogPlugin extends Plugin {
private static final String PLUGIN_ID = "org.eclipse.m2e.logback.configuration"; //$NON-NLS-1$
@@ -54,7 +56,11 @@ public class LogPlugin extends Plugin {
+ System.getProperty(ContextInitializer.CONFIG_FILE_PROPERTY));
return;
}
-
+ Location instanceLocation = Platform.getInstanceLocation();
+ if(!instanceLocation.isSet()) {
+ new Exception("The " + PLUGIN_ID + " bundle was activated before the platform instance location was initialized.");
+ return;
+ }
File stateDir = getStateLocation().toFile();
File configFile = new File(stateDir, "logback." + context.getBundle().getVersion().toString() + ".xml");

Back to the top