tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core RequestImpl.java
Date Tue, 11 Jul 2000 02:43:01 GMT
alex        00/07/10 19:43:01

  Modified:    src/share/org/apache/tomcat/core RequestImpl.java
  Log:
  Clean up logging, remove printStackTrace and System.out.println
  
  Logs to context log by default, else context manager log, else default tc_log
  
  Revision  Changes    Path
  1.54      +19 -3     jakarta-tomcat/src/share/org/apache/tomcat/core/RequestImpl.java
  
  Index: RequestImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/RequestImpl.java,v
  retrieving revision 1.53
  retrieving revision 1.54
  diff -u -r1.53 -r1.54
  --- RequestImpl.java	2000/07/03 08:54:01	1.53
  +++ RequestImpl.java	2000/07/11 02:43:01	1.54
  @@ -62,6 +62,7 @@
   
   import org.apache.tomcat.facade.*;
   import org.apache.tomcat.util.*;
  +import org.apache.tomcat.logging.*;
   import java.io.IOException;
   import java.io.*;
   import java.net.*;
  @@ -165,7 +166,7 @@
           StringManager.getManager("org.apache.tomcat.core");
   
       public RequestImpl() {
  -	//	System.out.println("XXX new ri " );
  +	//	log("XXX new ri " );
    	headers = new MimeHeaders();
    	recycle(); // XXX need better placement-super()
       }
  @@ -227,7 +228,7 @@
   	    return serverName;
   	}
   	// default to localhost - and warn
  -	//	System.out.println("No server name, defaulting to localhost");
  +	//	log("No server name, defaulting to localhost");
   	serverName="localhost";
   	return serverName;
       }
  @@ -467,7 +468,7 @@
   	//	context.log("RequestImpl:  created new session!");
   	contextM.doNewSessionRequest( this, response );
   	if ( serverSession == null ) {
  -	    context.log("RequestImpl: no session created!");
  +	    log("RequestImpl: no session created!");
   	    return null;
   	}
   
  @@ -906,4 +907,19 @@
   	return notes[pos];
       }
   
  +    Logger.Helper loghelper = new Logger.Helper("tc_log", this);
  +    
  +    protected void log(String s) {
  +	log(s, null);
  +    }
  +    protected void log(String s, Throwable t) {
  +	if (context != null) {
  +	    loghelper.setLogger(context.getLoggerHelper().getLogger());
  +	}
  +	else if (contextM != null) {
  +	    loghelper.setLogger(contextM.getLoggerHelper().getLogger());
  +	}
  +	loghelper.log(s);
  +    }		       
  +    
   }
  
  
  

Mime
View raw message