diff --git a/plugins/org.eclipse.jst.server.ui/.options b/plugins/org.eclipse.jst.server.ui/.options
index a747d69..045d38c 100644
--- a/plugins/org.eclipse.jst.server.ui/.options
+++ b/plugins/org.eclipse.jst.server.ui/.options
@@ -1,4 +1,10 @@
 # Debugging options for the org.eclipse.jst.server.ui plugin
 
-# Turn on general debugging
+# Turn on general tracing
 org.eclipse.jst.server.ui/debug=true
+
+# Tracing options
+org.eclipse.jst.server.ui/config=false
+org.eclipse.jst.server.ui/finest=false
+org.eclipse.jst.server.ui/warning=false
+org.eclipse.jst.server.ui/severe=false
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.jst.server.ui/META-INF/MANIFEST.MF
index 418151d..c72c58b 100644
--- a/plugins/org.eclipse.jst.server.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.jst.server.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jst.server.ui; singleton:=true
-Bundle-Version: 1.1.201.qualifier
+Bundle-Version: 1.1.202.qualifier
 Bundle-Activator: org.eclipse.jst.server.ui.internal.JavaServerUIPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
diff --git a/plugins/org.eclipse.jst.server.ui/src/org/eclipse/jst/server/ui/internal/ImageResource.java b/plugins/org.eclipse.jst.server.ui/src/org/eclipse/jst/server/ui/internal/ImageResource.java
index 684357d..861e500 100644
--- a/plugins/org.eclipse.jst.server.ui/src/org/eclipse/jst/server/ui/internal/ImageResource.java
+++ b/plugins/org.eclipse.jst.server.ui/src/org/eclipse/jst/server/ui/internal/ImageResource.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2009 IBM Corporation and others.
+ * Copyright (c) 2003, 2011 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -35,7 +35,9 @@
 			String pathSuffix = "icons/";
 			ICON_BASE_URL = JavaServerUIPlugin.getInstance().getBundle().getEntry(pathSuffix);
 		} catch (Exception e) {
-			Trace.trace(Trace.SEVERE, "Could not set icon base URL", e);
+			if(Trace.SEVERE) {
+				Trace.trace(Trace.STRING_SEVERE, "Could not set icon base URL", e);
+			}
 		}
 	}
 
@@ -96,7 +98,9 @@
 			imageRegistry.put(key, id);
 			imageDescriptors.put(key, id);
 		} catch (Exception e) {
-			Trace.trace(Trace.WARNING, "Error registering image " + key + " from " + partialURL, e);
+			if(Trace.WARNING) {
+				Trace.trace(Trace.STRING_WARNING, "Error registering image " + key + " from " + partialURL, e);
+			}
 		}
 	}
 }
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.ui/src/org/eclipse/jst/server/ui/internal/JavaServerUIPlugin.java b/plugins/org.eclipse.jst.server.ui/src/org/eclipse/jst/server/ui/internal/JavaServerUIPlugin.java
index 6eaf765..dbb47b8 100644
--- a/plugins/org.eclipse.jst.server.ui/src/org/eclipse/jst/server/ui/internal/JavaServerUIPlugin.java
+++ b/plugins/org.eclipse.jst.server.ui/src/org/eclipse/jst/server/ui/internal/JavaServerUIPlugin.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2011 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,12 +10,17 @@
  *******************************************************************************/
 package org.eclipse.jst.server.ui.internal;
 
+import java.util.Hashtable;
+
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.service.debug.DebugOptions;
+import org.eclipse.osgi.service.debug.DebugOptionsListener;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
 /**
  * The main server tooling plugin class.
  */
@@ -77,4 +82,14 @@
 			return null;
 		return workBench.getActiveWorkbenchWindow();
 	}
-}
+
+    public void start(BundleContext context) throws Exception {
+
+    	super.start(context);
+
+    	// register the debug options listener
+		final Hashtable<String, String> props = new Hashtable<String, String>(4);
+		props.put(DebugOptions.LISTENER_SYMBOLICNAME, JavaServerUIPlugin.PLUGIN_ID);
+		context.registerService(DebugOptionsListener.class.getName(), new Trace(), props);
+    }
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.ui/src/org/eclipse/jst/server/ui/internal/RuntimeLabelProvider.java b/plugins/org.eclipse.jst.server.ui/src/org/eclipse/jst/server/ui/internal/RuntimeLabelProvider.java
index f5be1c1..16ccb5d 100644
--- a/plugins/org.eclipse.jst.server.ui/src/org/eclipse/jst/server/ui/internal/RuntimeLabelProvider.java
+++ b/plugins/org.eclipse.jst.server.ui/src/org/eclipse/jst/server/ui/internal/RuntimeLabelProvider.java
@@ -1,5 +1,5 @@
 /******************************************************************************
- * Copyright (c) 2005 BEA Systems, Inc.
+ * Copyright (c) 2005, 2011 BEA Systems, Inc.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.jst.server.ui/src/org/eclipse/jst/server/ui/internal/Trace.java b/plugins/org.eclipse.jst.server.ui/src/org/eclipse/jst/server/ui/internal/Trace.java
index 0f54f82..9ea245b 100644
--- a/plugins/org.eclipse.jst.server.ui/src/org/eclipse/jst/server/ui/internal/Trace.java
+++ b/plugins/org.eclipse.jst.server.ui/src/org/eclipse/jst/server/ui/internal/Trace.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2011 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,48 +12,80 @@
 
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.service.debug.DebugOptions;
+import org.eclipse.osgi.service.debug.DebugOptionsListener;
+
 /**
  * Helper class to route trace output.
  */
-public class Trace {
-	public static final byte CONFIG = 0;
-	public static final byte WARNING = 1;
-	public static final byte SEVERE = 2;
-	public static final byte FINEST = 3;
+public class Trace implements DebugOptionsListener {
 
+	// tracing enablement flags
+	public static boolean CONFIG = false;
+	public static boolean WARNING = false;
+	public static boolean SEVERE = false;
+	public static boolean FINEST = false;
+
+	// tracing levels.  One most exist for each debug option
+	public final static String STRING_CONFIG = "/config"; //$NON-NLS-1$
+	public final static String STRING_FINEST = "/finest"; //$NON-NLS-1$
+	public final static String STRING_WARNING = "/warning"; //$NON-NLS-1$
+	public final static String STRING_SEVERE = "/severe"; //$NON-NLS-1$
+	
 	/**
-	 * Trace constructor comment.
+	 * Trace constructor. This should never be explicitly called by clients and is used to register this class with the
+	 * {@link DebugOptions} service.
 	 */
-	private Trace() {
+	public Trace() {
 		super();
 	}
 
-	/**
-	 * Trace the given text.
-	 *
-	 * @param level a trace level
-	 * @param s a message
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.eclipse.osgi.service.debug.DebugOptionsListener#optionsChanged(org.eclipse.osgi.service.debug.DebugOptions)
 	 */
-	public static void trace(byte level, String s) {
+	public void optionsChanged(DebugOptions options) {
+		Trace.CONFIG = options.getBooleanOption(JavaServerUIPlugin.PLUGIN_ID + Trace.STRING_CONFIG, false);
+		Trace.WARNING = options.getBooleanOption(JavaServerUIPlugin.PLUGIN_ID + Trace.STRING_WARNING, false);
+		Trace.SEVERE = options.getBooleanOption(JavaServerUIPlugin.PLUGIN_ID + Trace.STRING_SEVERE, false);
+		Trace.FINEST = options.getBooleanOption(JavaServerUIPlugin.PLUGIN_ID + Trace.STRING_FINEST, false);
+	}
+
+	/**
+	 * Trace the given message.
+	 * 
+	 * @param level
+	 *            The tracing level.
+	 * @param s
+	 *            The message to trace
+	 */
+	public static void trace(final String level, final String s) {
 		Trace.trace(level, s, null);
 	}
-	
+
 	/**
 	 * Trace the given message and exception.
-	 *
-	 * @param level a trace level
-	 * @param s a message
-	 * @param t a throwable
+	 * 
+	 * @param level
+	 *            The tracing level.
+	 * @param s
+	 *            The message to trace
+	 * @param t
+	 *            A {@link Throwable} to trace
 	 */
-	public static void trace(byte level, String s, Throwable t) {
-		if (level == SEVERE)
-			JavaServerUIPlugin.getInstance().getLog().log(new Status(IStatus.ERROR, JavaServerUIPlugin.PLUGIN_ID, s, t));
-		
-		if (!JavaServerUIPlugin.getInstance().isDebugging())
-			return;
-		
-		System.out.println(JavaServerUIPlugin.PLUGIN_ID + " " + s);
-		if (t != null)
-			t.printStackTrace();
-	}
+	public static void trace(final String level, final String s, final Throwable t) {
+
+		if (Trace.STRING_SEVERE.equals(level)) {
+			JavaServerUIPlugin.getInstance().getLog()
+					.log(new Status(IStatus.ERROR, JavaServerUIPlugin.PLUGIN_ID, s, t));
+		}
+		if (JavaServerUIPlugin.getInstance().isDebugging()) {
+			System.out.println(JavaServerUIPlugin.PLUGIN_ID + " " + level + " " + s);
+			if (t != null) {
+				t.printStackTrace();
+			}
+		}
+	}	
 }
\ No newline at end of file
