User: starksm
Date: 01/06/19 21:04:49
Modified: src/main/org/jboss/web WebServer.java
Log:
Use the custom log4j JBossCategory to issue trace level msgs
Revision Changes Path
1.8 +8 -4 jboss/src/main/org/jboss/web/WebServer.java
Index: WebServer.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/web/WebServer.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- WebServer.java 2001/06/19 03:29:54 1.7
+++ WebServer.java 2001/06/20 04:04:49 1.8
@@ -21,6 +21,8 @@
import java.util.HashMap;
import java.util.Properties;
+import org.jboss.logging.log4j.JBossCategory;
+
/**
* A mini webserver that should be embedded in another application. It can server
any file that is available from
* classloaders that are registered with it, including class-files.
@@ -34,10 +36,11 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Scott Stark</a>.
- * @version $Revision: 1.7 $
+ * @version $Revision: 1.8 $
*
* Revisions:
*
+ * 20010619 scott.stark: Use log4j JBossCategory to enable trace level msgs
* 20010618 scott.stark: Fixed extraction of mime-type from file extension in
getMimeType
*/
public class WebServer
@@ -46,6 +49,7 @@
// Constants -----------------------------------------------------
// Attributes ----------------------------------------------------
+ private static JBossCategory category =
(JBossCategory)JBossCategory.getInstance(WebServer.class);
/** The port the web server listens on */
private int port = 8080;
/** The map of class loaders registered with the web server */
@@ -311,11 +315,11 @@
protected void trace(String msg)
{
- System.out.println(msg);
+ category.trace(msg);
}
protected void debug(String msg)
{
- System.out.println(msg);
+ category.debug(msg);
}
protected void listen()
@@ -329,7 +333,7 @@
protected String getPath(BufferedReader in) throws IOException
{
String line = in.readLine();
- debug("WebServer: raw path="+line);
+ trace("WebServer: raw path="+line);
// Find the request path by parsing the 'REQUEST_TYPE filePath
HTTP_VERSION' string
int start = line.indexOf(' ')+1;
int end = line.indexOf(' ', start+1);
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development