[200123] Send errors to .log
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Trace.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Trace.java
index 224c64d..8e9f0f6 100644
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Trace.java
+++ b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Trace.java
@@ -9,6 +9,9 @@
  *     IBM Corporation - Initial API and implementation
  *******************************************************************************/
 package org.eclipse.jst.server.core.internal;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
 /**
  * Helper class to route trace output.
  */
@@ -57,6 +60,9 @@
 	 * @param t Throwable
 	 */
 	public static void trace(byte level, String s, Throwable t) {
+		if (level == SEVERE)
+			JavaServerPlugin.getInstance().getLog().log(new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, s, t));
+		
 		if (!JavaServerPlugin.getInstance().isDebugging())
 			return;
 		
diff --git a/plugins/org.eclipse.jst.server.preview.adapter/src/org/eclipse/jst/server/preview/adapter/internal/Trace.java b/plugins/org.eclipse.jst.server.preview.adapter/src/org/eclipse/jst/server/preview/adapter/internal/Trace.java
index bf221ca..29b7081 100644
--- a/plugins/org.eclipse.jst.server.preview.adapter/src/org/eclipse/jst/server/preview/adapter/internal/Trace.java
+++ b/plugins/org.eclipse.jst.server.preview.adapter/src/org/eclipse/jst/server/preview/adapter/internal/Trace.java
@@ -9,6 +9,9 @@
  *     IBM Corporation - Initial API and implementation
  *******************************************************************************/
 package org.eclipse.jst.server.preview.adapter.internal;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
 /**
  * Helper class to route trace output.
  */
@@ -57,6 +60,9 @@
 	 * @param t Throwable
 	 */
 	public static void trace(byte level, String s, Throwable t) {
+		if (level == SEVERE)
+			PreviewPlugin.getInstance().getLog().log(new Status(IStatus.ERROR, PreviewPlugin.PLUGIN_ID, s, t));
+		
 		if (!PreviewPlugin.getInstance().isDebugging())
 			return;
 		
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 2996a5f..0f54f82 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
@@ -9,6 +9,9 @@
  *     IBM Corporation - Initial API and implementation
  *******************************************************************************/
 package org.eclipse.jst.server.ui.internal;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
 /**
  * Helper class to route trace output.
  */
@@ -43,9 +46,12 @@
 	 * @param t a throwable
 	 */
 	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();
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Trace.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Trace.java
index 48b722a..ebf3926 100644
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Trace.java
+++ b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Trace.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
+ * Copyright (c) 2003, 2007 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
@@ -9,6 +9,9 @@
  *     IBM Corporation - Initial API and implementation
  *******************************************************************************/
 package org.eclipse.wst.internet.monitor.core.internal;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
 /**
  * Helper class to route trace output.
  */
@@ -63,9 +66,12 @@
 	 * @param t a throwable
 	 */
 	public static void trace(byte level, String s, Throwable t) {
+		if (level == SEVERE)
+			MonitorPlugin.getInstance().getLog().log(new Status(IStatus.ERROR, MonitorPlugin.PLUGIN_ID, s, t));
+		
 		if (!MonitorPlugin.getInstance().isDebugging())
 			return;
-
+		
 		System.out.println(MonitorPlugin.PLUGIN_ID + " " + System.currentTimeMillis() + " " + s);
 		if (t != null)
 			t.printStackTrace();
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/Trace.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/Trace.java
index 88d916c..587ac3b 100644
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/Trace.java
+++ b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/Trace.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
+ * Copyright (c) 2003, 2007 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
@@ -9,6 +9,11 @@
  *     IBM Corporation - Initial API and implementation
  *******************************************************************************/
 package org.eclipse.wst.internet.monitor.ui.internal;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.internet.monitor.core.internal.MonitorPlugin;
+
 /**
  * Helper class to route trace output.
  */
@@ -43,9 +48,12 @@
 	 * @param t a throwable
 	 */
 	public static void trace(byte level, String s, Throwable t) {
+		if (level == SEVERE)
+			MonitorPlugin.getInstance().getLog().log(new Status(IStatus.ERROR, MonitorPlugin.PLUGIN_ID, s, t));
+		
 		if (!MonitorUIPlugin.getInstance().isDebugging())
 			return;
-
+		
 		System.out.println(MonitorUIPlugin.PLUGIN_ID + " " + s);
 		if (t != null)
 			t.printStackTrace();
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Trace.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Trace.java
index 83783e4..63a3887 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Trace.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Trace.java
@@ -12,6 +12,9 @@
 
 import java.text.SimpleDateFormat;
 import java.util.Date;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
 /**
  * Helper class to route trace output.
  */
@@ -33,12 +36,9 @@
 	private static final String[] levelNames = new String[] {
 		"CONFIG   ", "INFO     ", "WARNING  ", "SEVERE   ", "FINER    ", "FINEST   ",
 		"RESOURCES", "EXTENSION", "LISTENERS", "TARGET   ", "PERF     ", "PUBLISH  "};
-	private static final String spacer = "                                   ";
 
 	private static final SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yy HH:mm.ss.SSS");
 
-	protected static int pluginLength = -1;
-
 	/**
 	 * Trace constructor comment.
 	 */
@@ -64,28 +64,16 @@
 	 * @param t a throwable
 	 */
 	public static void trace(int level, String s, Throwable t) {
-		trace(ServerPlugin.PLUGIN_ID, level, s, t);
-	}
-
-	/**
-	 * Trace the given message and exception.
-	 *
-	 * @param level a trace level
-	 * @param s a message
-	 * @param t a throwable
-	 */
-	private static void trace(String pluginId, int level, String s, Throwable t) {
-		if (pluginId == null || s == null)
+		if (s == null)
 			return;
-
+		
+		if (level == SEVERE)
+			ServerPlugin.log(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, s, t));
+		
 		if (!ServerPlugin.getInstance().isDebugging())
 			return;
 		
-		StringBuffer sb = new StringBuffer(pluginId);
-		if (pluginId.length() > pluginLength)
-			pluginLength = pluginId.length();
-		else if (pluginId.length() < pluginLength)
-			sb.append(spacer.substring(0, pluginLength - pluginId.length()));
+		StringBuffer sb = new StringBuffer(ServerPlugin.PLUGIN_ID);
 		sb.append(" ");
 		sb.append(levelNames[level]);
 		sb.append(" ");
diff --git a/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/Trace.java b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/Trace.java
index dab0b8b..5977cd0 100644
--- a/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/Trace.java
+++ b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/Trace.java
@@ -13,6 +13,8 @@
 import java.text.SimpleDateFormat;
 import java.util.Date;
 
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
 /**
  * Helper class to route trace output.
  */
@@ -26,13 +28,9 @@
 	private static final String[] levelNames = new String[] { "CONFIG   ", "WARNING  ",
 		"SEVERE   ", "FINER    ", "FINEST   " };
 
-	private static final String spacer = "                                   ";
-
 	private static final SimpleDateFormat sdf = new SimpleDateFormat(
 			"dd/MM/yy HH:mm.ss.SSS");
 
-	protected static int pluginLength = -1;
-
 	/**
 	 * Trace constructor comment.
 	 */
@@ -58,35 +56,16 @@
 	 * @param t a throwable
 	 */
 	public static void trace(byte level, String s, Throwable t) {
+		if (s == null)
+			return;
+		
+		if (level == SEVERE)
+			HttpCorePlugin.getInstance().getLog().log(new Status(IStatus.ERROR, HttpCorePlugin.PLUGIN_ID, s, t));
+		
 		if (!HttpCorePlugin.getInstance().isDebugging())
 			return;
 
-		/*
-		 * System.out.println(ApachePlugin.PLUGIN_ID + " " + s); if (t != null)
-		 * t.printStackTrace();
-		 */
-		trace(HttpCorePlugin.PLUGIN_ID, level, s, t);
-	}
-
-	/**
-	 * Trace the given message and exception.
-	 * 
-	 * @param level a trace level
-	 * @param s a message
-	 * @param t a throwable
-	 */
-	private static void trace(String pluginId, int level, String s, Throwable t) {
-		if (pluginId == null || s == null)
-			return;
-
-		if (!HttpCorePlugin.getInstance().isDebugging())
-			return;
-
-		StringBuffer sb = new StringBuffer(pluginId);
-		if (pluginId.length() > pluginLength)
-			pluginLength = pluginId.length();
-		else if (pluginId.length() < pluginLength)
-			sb.append(spacer.substring(0, pluginLength - pluginId.length()));
+		StringBuffer sb = new StringBuffer(HttpCorePlugin.PLUGIN_ID);
 		sb.append(" ");
 		sb.append(levelNames[level]);
 		sb.append(" ");
diff --git a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/Trace.java b/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/Trace.java
index d0a557c..512c326 100644
--- a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/Trace.java
+++ b/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/Trace.java
@@ -9,6 +9,9 @@
  *     IBM Corporation - Initial API and implementation
  *******************************************************************************/
 package org.eclipse.wst.server.http.ui.internal;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
 /**
  * Helper class to route trace output.
  */
@@ -44,6 +47,9 @@
 	 * @param t a throwable
 	 */
 	public static void trace(byte level, String s, Throwable t) {
+		if (level == SEVERE)
+			HttpUIPlugin.getInstance().getLog().log(new Status(IStatus.ERROR, HttpUIPlugin.PLUGIN_ID, s, t));
+		
 		if (!HttpUIPlugin.getInstance().isDebugging())
 			return;
 
diff --git a/plugins/org.eclipse.wst.server.preview.adapter/src/org/eclipse/wst/server/preview/adapter/internal/core/Trace.java b/plugins/org.eclipse.wst.server.preview.adapter/src/org/eclipse/wst/server/preview/adapter/internal/core/Trace.java
index 30e71db..c1b1f53 100644
--- a/plugins/org.eclipse.wst.server.preview.adapter/src/org/eclipse/wst/server/preview/adapter/internal/core/Trace.java
+++ b/plugins/org.eclipse.wst.server.preview.adapter/src/org/eclipse/wst/server/preview/adapter/internal/core/Trace.java
@@ -13,6 +13,8 @@
 import java.text.SimpleDateFormat;
 import java.util.Date;
 
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
 /**
  * Helper class to route trace output.
  */
@@ -22,16 +24,11 @@
 	public static byte SEVERE = 2;
 	public static byte FINEST = 3;
 	public static byte FINER = 4;
-	
+
 	private static final String[] levelNames = new String[] { "CONFIG   ", "WARNING  ",
 		"SEVERE   ", "FINER    ", "FINEST   " };
 
-	private static final String spacer = "                                   ";
-
-	private static final SimpleDateFormat sdf = new SimpleDateFormat(
-			"dd/MM/yy HH:mm.ss.SSS");
-
-	protected static int pluginLength = -1;
+	private static final SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yy HH:mm.ss.SSS");
 
 	/**
 	 * Trace constructor comment.
@@ -58,35 +55,16 @@
 	 * @param t a throwable
 	 */
 	public static void trace(byte level, String s, Throwable t) {
+		if (s == null)
+			return;
+		
+		if (level == SEVERE)
+			PreviewPlugin.getInstance().getLog().log(new Status(IStatus.ERROR, PreviewPlugin.PLUGIN_ID, s, t));
+		
 		if (!PreviewPlugin.getInstance().isDebugging())
 			return;
-
-		/*
-		 * System.out.println(ApachePlugin.PLUGIN_ID + " " + s); if (t != null)
-		 * t.printStackTrace();
-		 */
-		trace(PreviewPlugin.PLUGIN_ID, level, s, t);
-	}
-
-	/**
-	 * Trace the given message and exception.
-	 * 
-	 * @param level a trace level
-	 * @param s a message
-	 * @param t a throwable
-	 */
-	private static void trace(String pluginId, int level, String s, Throwable t) {
-		if (pluginId == null || s == null)
-			return;
-
-		if (!PreviewPlugin.getInstance().isDebugging())
-			return;
-
-		StringBuffer sb = new StringBuffer(pluginId);
-		if (pluginId.length() > pluginLength)
-			pluginLength = pluginId.length();
-		else if (pluginId.length() < pluginLength)
-			sb.append(spacer.substring(0, pluginLength - pluginId.length()));
+		
+		StringBuffer sb = new StringBuffer(PreviewPlugin.PLUGIN_ID);
 		sb.append(" ");
 		sb.append(levelNames[level]);
 		sb.append(" ");
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Trace.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Trace.java
index 2fb5020..8912f4b 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Trace.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Trace.java
@@ -12,6 +12,9 @@
 
 import java.text.SimpleDateFormat;
 import java.util.Date;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
 /**
  * Helper class to route trace output.
  */
@@ -24,12 +27,9 @@
 	public static final byte FINER = 5;
 	public static final byte PERFORMANCE = 6;
 	public static final byte EXTENSION_POINT = 7;
-	
-	protected static int pluginLength = -1;
-	
+
 	private static final String[] levelNames = new String[] {
 		"CONFIG ", "INFO   ", "WARNING", "SEVERE ", "FINER  ", "FINEST ", "PERF   ", "EXTENSION"};
-	private static final String spacer = "                                   ";
 
 	private static final SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yy HH:mm.ss.SSS");
 
@@ -49,7 +49,7 @@
 	public static void trace(byte level, String s) {
 		trace(level, s, null);
 	}
-	
+
 	/**
 	 * Trace the given message and exception.
 	 *
@@ -58,15 +58,13 @@
 	 * @param t a throwable
 	 */
 	public static void trace(byte level, String s, Throwable t) {
+		if (level == SEVERE)
+			ServerUIPlugin.getInstance().getLog().log(new Status(IStatus.ERROR, ServerUIPlugin.PLUGIN_ID, s, t));
+		
 		if (!ServerUIPlugin.getInstance().isDebugging())
 			return;
-
-		String pluginId = ServerUIPlugin.PLUGIN_ID;
-		StringBuffer sb = new StringBuffer(pluginId);
-		if (pluginId.length() > pluginLength)
-			pluginLength = pluginId.length();
-		else if (pluginId.length() < pluginLength)
-			sb.append(spacer.substring(0, pluginLength - pluginId.length()));
+		
+		StringBuffer sb = new StringBuffer(ServerUIPlugin.PLUGIN_ID);
 		sb.append(" ");
 		sb.append(levelNames[level]);
 		sb.append(" ");