You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@locus.apache.org on 2000/04/06 23:14:46 UTC
cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/service SimpleTcpConnector.java
costin 00/04/06 14:14:46
Modified: src/share/org/apache/tomcat/context AutoSetup.java
src/share/org/apache/tomcat/core Context.java
ContextManager.java
src/share/org/apache/tomcat/service SimpleTcpConnector.java
Log:
Removed XML formating from log messages. This is not complete - but the
messages that show up when debug is disabled are now plain text.
For debug messages - they are intended for debugging. In time I'll remove
or change more messages - but I don't think it's a show stopper.
I made an attempt to implement something that ( IMHO ) was usefull, but
since most people disagreed - I'm looking forward to see better code/solutions.
It seems XML doesn't apply to log messages - we want "portable" config, but
not portable logs.
Revision Changes Path
1.10 +1 -1 jakarta-tomcat/src/share/org/apache/tomcat/context/AutoSetup.java
Index: AutoSetup.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/context/AutoSetup.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- AutoSetup.java 2000/03/25 03:35:25 1.9
+++ AutoSetup.java 2000/04/06 21:14:45 1.10
@@ -144,7 +144,7 @@
// don't assume HOME==TOMCAT_HOME
File f=new File( webappD, name);
ctx.setDocBase( f.getAbsolutePath() );
- ctx.log("<l:autoLoadContext docBase=\"" + ctx.getDocBase() + "\" />");
+ ctx.log("Automatic context load docBase=\"" + ctx.getDocBase() + "\"");
cm.addContext(ctx);
} else {
//System.out.println("Already set up: " + path + " " + cm.getContext(path));
1.78 +5 -3 jakarta-tomcat/src/share/org/apache/tomcat/core/Context.java
Index: Context.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Context.java,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -r1.77 -r1.78
--- Context.java 2000/04/05 03:36:42 1.77
+++ Context.java 2000/04/06 21:14:45 1.78
@@ -615,7 +615,7 @@
if( msg.startsWith( "<l:" ))
contextM.doLog( msg, t );
else
- contextM.doLog("<l:ctx path=\"" + path + "\" >" + msg + "</l:ctx>", t);
+ contextM.doLog("Context log: path=\"" + path + "\" " + msg, t);
}
boolean firstLog = true;
@@ -633,9 +633,11 @@
}
}
if (csLog != null) {
- csLog.log("<l:context path=\"" + path + "\" >" + msg + "</l:context>\n");
+ csLog.log("Context log path=\"" + path + "\" :" + msg + "\n");
+ // csLog.log("<l:context path=\"" + path + "\" >" + msg + "</l:context>\n");
} else {
- System.out.println("<l:context path=\"" + path + "\" >" + msg + "</l:context>");
+ System.out.println("Context log path=\"" + path + "\"" + msg);
+ // System.out.println("<l:context path=\"" + path + "\" >" + msg + "</l:context>");
}
}
1.68 +10 -10 jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
Index: ContextManager.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -r1.67 -r1.68
--- ContextManager.java 2000/04/02 00:07:43 1.67
+++ ContextManager.java 2000/04/06 21:14:45 1.68
@@ -185,7 +185,7 @@
*/
public void init() throws TomcatException {
String cp=System.getProperty( "java.class.path");
- log( "<l:tomcat install=\"" + getTomcatHome() + "\" home=\"" + home + "\" classPath=\"" + cp + "\" />");
+ log( "Starting tomcat install=\"" + getTomcatHome() + "\" home=\"" + home + "\" classPath=\"" + cp + "\"");
// long time=System.currentTimeMillis();
ContextInterceptor cI[]=getContextInterceptors();
for( int i=0; i< cI.length; i++ ) {
@@ -299,7 +299,7 @@
cI[i].addContext( this, ctx );
}
- ctx.log("<l:addContext path=\"" + ctx.getPath() + "\" docBase=\"" + ctx.getDocBase() + "\" />");
+ ctx.log("Adding context path=\"" + ctx.getPath() + "\" docBase=\"" + ctx.getDocBase() + "\"");
contexts.put( path, ctx );
}
@@ -311,7 +311,7 @@
*/
public void removeContext(String name) throws TomcatException {
Context context = (Context)contexts.get(name);
- log( "<l:removeContext path=\"" + context.getPath() + "\" />");
+ log( "Removing context path=\"" + context.getPath() + "\" ");
ContextInterceptor cI[]=getContextInterceptors();
for( int i=0; i< cI.length; i++ ) {
@@ -350,7 +350,7 @@
* @param con The new server connector
*/
public synchronized void addServerConnector( ServerConnector con ) {
- if(debug>0) log("<l:addConnector javaClass=\"" + con.getClass().getName() + "\" />");
+ if(debug>0) log("Add connector javaClass=\"" + con.getClass().getName() + "\"");
con.setContextManager( this );
connectors.addElement( con );
}
@@ -360,7 +360,7 @@
}
public void addRequestInterceptor( RequestInterceptor ri ) {
- if(debug>0) log("<l:requestInterceptor javaClass=\"" + ri.getClass().getName() + "\" />");
+ if(debug>0) log("Add requestInterceptor javaClass=\"" + ri.getClass().getName() + "\" ");
requestInterceptors.addElement( ri );
if( ri instanceof ContextInterceptor )
contextInterceptors.addElement( ri );
@@ -386,7 +386,7 @@
}
public void addContextInterceptor( ContextInterceptor ci) {
- if(debug>0) log("<l:contextInterceptor javaClass=\"" + ci.getClass().getName() + "\" />");
+ if(debug>0) log("Add contextInterceptor javaClass=\"" + ci.getClass().getName() + "\" ");
contextInterceptors.addElement( ci );
}
@@ -808,10 +808,10 @@
}
public final void log(String msg) {
- if( msg.startsWith( "<l:" ))
- doLog( msg );
- else
- doLog("<l:tc>" + msg + "</l:tc>");
+ // if( msg.startsWith( "<l:" ))
+ doLog( msg );
+ //else
+ //doLog("<l:tc>" + msg + "</l:tc>");
}
boolean firstLog = true;
1.4 +5 -5 jakarta-tomcat/src/share/org/apache/tomcat/service/SimpleTcpConnector.java
Index: SimpleTcpConnector.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/SimpleTcpConnector.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- SimpleTcpConnector.java 2000/03/24 03:29:37 1.3
+++ SimpleTcpConnector.java 2000/04/06 21:14:46 1.4
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/SimpleTcpConnector.java,v 1.3 2000/03/24 03:29:37 craigmcc Exp $
- * $Revision: 1.3 $
- * $Date: 2000/03/24 03:29:37 $
+ * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/SimpleTcpConnector.java,v 1.4 2000/04/06 21:14:46 costin Exp $
+ * $Revision: 1.4 $
+ * $Date: 2000/04/06 21:14:46 $
*
* ====================================================================
*
@@ -140,11 +140,11 @@
}
ep.setConnectionHandler( con );
ep.startEndpoint();
- cm.log("<l:startEndpoint port=\"" + port + "\" handler=\"" + con.getClass().getName() + "\" />");
+ cm.log("Starting endpoint port=\"" + port + "\" handler=\"" + con.getClass().getName() + "\" ");
}
public void stop() throws Exception {
- cm.log("<l:stopEndpoint port=\"" + port + "\" handler=\"" + con.getClass().getName() + "\" />");
+ cm.log("Stoping endpoint port=\"" + port + "\" handler=\"" + con.getClass().getName() + "\" ");
ep.stopEndpoint();
}