tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/startup Tomcat.java
Date Fri, 02 Mar 2001 04:49:36 GMT
costin      01/03/01 20:49:36

  Modified:    src/share/org/apache/tomcat/core Context.java
               src/share/org/apache/tomcat/modules/config ApacheConfig.java
                        IISConfig.java LogSetter.java NSConfig.java
                        PolicyInterceptor.java
               src/share/org/apache/tomcat/modules/generators
                        ErrorHandler.java
               src/share/org/apache/tomcat/modules/server Ajp12.java
                        Ajp13Interceptor.java Http10.java
                        Http10Interceptor.java
               src/share/org/apache/tomcat/modules/session
                        SimpleSessionStore.java
               src/share/org/apache/tomcat/startup Tomcat.java
  Log:
  Stop using Logger or the the Log constructor.
  
  Revision  Changes    Path
  1.141     +2 -1      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.140
  retrieving revision 1.141
  diff -u -r1.140 -r1.141
  --- Context.java	2001/02/27 16:54:01	1.140
  +++ Context.java	2001/03/02 04:49:06	1.141
  @@ -583,7 +583,8 @@
   	if( "/".equals(path) )
   	    path="";
   	this.path = path;
  -	loghelper.setLogPrefix("Ctx("+ getId() +") ");
  +	loghelper=Log.getLog("org/apache/tomcat/core",
  +			     "Ctx("+ getId() +") ");
       }
   
       /**
  
  
  
  1.6       +1 -1      jakarta-tomcat/src/share/org/apache/tomcat/modules/config/ApacheConfig.java
  
  Index: ApacheConfig.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/config/ApacheConfig.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ApacheConfig.java	2001/02/20 03:16:51	1.5
  +++ ApacheConfig.java	2001/03/02 04:49:11	1.6
  @@ -119,7 +119,7 @@
   
   
       
  -    Log loghelper = new Log("tc_log", this);
  +    Log loghelper = Log.getLog("tc_log", this);
   
       public void execute(ContextManager cm) throws TomcatException {
   	try {
  
  
  
  1.3       +1 -1      jakarta-tomcat/src/share/org/apache/tomcat/modules/config/IISConfig.java
  
  Index: IISConfig.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/config/IISConfig.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- IISConfig.java	2001/02/13 04:30:16	1.2
  +++ IISConfig.java	2001/03/02 04:49:12	1.3
  @@ -78,7 +78,7 @@
       public static final String JK_LOG_LOCATION = "/logs/iis_redirect.log";
       public static final String IIS_REG_FILE = "/conf/jk/iis_redirect.reg";    
   
  -    Log loghelper = new Log("tc_log", "IISConfig");
  +    Log loghelper = Log.getLog("tc_log", "IISConfig");
   
       public IISConfig() 
       {
  
  
  
  1.9       +22 -3     jakarta-tomcat/src/share/org/apache/tomcat/modules/config/LogSetter.java
  
  Index: LogSetter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/config/LogSetter.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- LogSetter.java	2001/02/20 03:16:51	1.8
  +++ LogSetter.java	2001/03/02 04:49:13	1.9
  @@ -61,6 +61,7 @@
   
   import org.apache.tomcat.core.*;
   import org.apache.tomcat.util.log.*;
  +import org.apache.tomcat.util.qlog.*;
   import org.apache.tomcat.util.io.FileUtil;
   import java.io.*;
   import java.net.*;
  @@ -192,6 +193,15 @@
       {
   	if( module!=this ) return;
   
  +	LogManager logManager=(LogManager)cm.getNote("tc.LogManager");
  +	
  +	// Log will redirect all Log.getLog to us
  +	if( logManager==null ) {
  +	    logManager=new TomcatLogManager();
  +	    cm.setNote("tc.LogManager", logManager);
  +	    Log.setLogManager( logManager );
  +	}
  +	
   	if( name==null ) {
   	    if( servletLogger )
   		name="org/apache/tomcat/facade";
  @@ -220,7 +230,6 @@
   	
   	// construct a queue logger
   	QueueLogger ql=new QueueLogger();
  -	ql.setName(name);
   	if( ! timestamps )
   	    ql.setTimestamp( "false" );
   	if( tsFormat!=null )
  @@ -233,7 +242,7 @@
   
   	ql.open();
   
  -	Logger.putLogger( ql );
  +	logManager.addChannel( name, ql );
   
   	if( "org/apache/tomcat/core".equals( name ) ) {
   	    // this will be the Log interface to the log we just created
  @@ -252,8 +261,18 @@
   
       }
   
  +    /** Adapter and registry for QueueLoggers
  +     */
  +    static class TomcatLogManager extends LogManager {
   
  -    // XXX Flush the buffers on shutdown !!!!!!
  +	void addChannel( String name, Log log ) {
  +	    
  +	}
   
  +    }
  +    
  +
  +    
  +    // XXX Flush the buffers on shutdown !!!!!!
   
   }
  
  
  
  1.3       +1 -1      jakarta-tomcat/src/share/org/apache/tomcat/modules/config/NSConfig.java
  
  Index: NSConfig.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/config/NSConfig.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- NSConfig.java	2001/02/20 03:16:51	1.2
  +++ NSConfig.java	2001/03/02 04:49:14	1.3
  @@ -77,7 +77,7 @@
       public static final String NS_CONFIG = "/conf/jk/obj.conf";
       public static final String JK_LOG_LOCATION = "/logs/netscape_redirect.log";
   
  -    Log loghelper = new Log("tc_log", this);
  +    Log loghelper = Log.getLog("tc_log", this);
       
       public NSConfig() 
       {
  
  
  
  1.9       +3 -3      jakarta-tomcat/src/share/org/apache/tomcat/modules/config/PolicyInterceptor.java
  
  Index: PolicyInterceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/config/PolicyInterceptor.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- PolicyInterceptor.java	2001/02/20 03:16:52	1.8
  +++ PolicyInterceptor.java	2001/03/02 04:49:14	1.9
  @@ -128,13 +128,13 @@
   	    Object o=c.newInstance();
   	    System.setSecurityManager((SecurityManager)o);
   	    if (debug>0) log("Security Manager set to " +
  -		securityManagerClass, Logger.DEBUG);
  +		securityManagerClass, Log.DEBUG);
   	} catch( ClassNotFoundException ex ) {
   	    log("SecurityManager Class not found: " +
  -			       securityManagerClass, Logger.ERROR);
  +			       securityManagerClass, Log.ERROR);
   	} catch( Exception ex ) {
               log("SecurityManager Class could not be loaded: " +
  -			       securityManagerClass, Logger.ERROR);
  +			       securityManagerClass, Log.ERROR);
   	}
       }
   
  
  
  
  1.8       +5 -2      jakarta-tomcat/src/share/org/apache/tomcat/modules/generators/ErrorHandler.java
  
  Index: ErrorHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/generators/ErrorHandler.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ErrorHandler.java	2001/02/20 03:16:52	1.7
  +++ ErrorHandler.java	2001/03/02 04:49:19	1.8
  @@ -61,6 +61,7 @@
   
   import org.apache.tomcat.core.*;
   import org.apache.tomcat.util.res.StringManager;
  +import org.apache.tomcat.util.qlog.Logger;
   import java.io.*;
   import java.net.*;
   import java.util.*;
  @@ -245,12 +246,12 @@
   	} else if( t instanceof IOException ) {
               if( "Broken pipe".equals(t.getMessage()))
   	    {
  -		ctx.log("Broken pipe in " + req, t, Logger.DEBUG);  // tuneme
  +		ctx.log("Broken pipe in " + req, t, Log.DEBUG);  // tuneme
   		return;
   	    }
               if( "Connection reset by peer".equals(t.getMessage()))
   	    {
  -		ctx.log("Connection reset by peer in " + req, t, Logger.DEBUG);  // tuneme
  +		ctx.log("Connection reset by peer in " + req, t, Log.DEBUG);  // tuneme
   		return;
   	    }
   
  @@ -550,6 +551,8 @@
   	res.getBuffer().write( buf );
   	buf.setLength(0);
       }
  +
  +    
   }
   
   class StatusHandler extends Handler {
  
  
  
  1.16      +1 -1      jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Ajp12.java
  
  Index: Ajp12.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Ajp12.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- Ajp12.java	2001/02/27 02:55:41	1.15
  +++ Ajp12.java	2001/03/02 04:49:23	1.16
  @@ -271,7 +271,7 @@
                                   ContextManager cm=req.getContextManager();
   				cm.shutdown();
   				cm.log("Exiting" );
  -				cm.getLog().getLogger().flush();
  +				cm.getLog().flush();
   				// same behavior as in past, because it seems
   				// that stopping everything doesn't work -
   				// need to figure
  
  
  
  1.8       +4 -4      jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Ajp13Interceptor.java
  
  Index: Ajp13Interceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Ajp13Interceptor.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Ajp13Interceptor.java	2001/02/07 07:01:25	1.7
  +++ Ajp13Interceptor.java	2001/03/02 04:49:23	1.8
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Ajp13Interceptor.java,v
1.7 2001/02/07 07:01:25 costin Exp $
  - * $Revision: 1.7 $
  - * $Date: 2001/02/07 07:01:25 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Ajp13Interceptor.java,v
1.8 2001/03/02 04:49:23 costin Exp $
  + * $Revision: 1.8 $
  + * $Date: 2001/03/02 04:49:23 $
    *
    * ====================================================================
    *
  @@ -164,7 +164,7 @@
   		req.recycle();
   		res.recycle();
               }
  -            log("Closing connection", Logger.DEBUG);
  +            log("Closing connection", Log.DEBUG);
               con.close();
   	    socket.close();
           } catch (Exception e) {
  
  
  
  1.9       +1 -1      jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Http10.java
  
  Index: Http10.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Http10.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Http10.java	2001/02/20 03:16:53	1.8
  +++ Http10.java	2001/03/02 04:49:24	1.9
  @@ -86,7 +86,7 @@
       protected int oBufferCount = 0;
   
       static final byte CRLF[]= { (byte)'\r', (byte)'\n' };
  -    Log loghelper = new Log("tc_log", this);
  +    Log loghelper = Log.getLog("tc_log", this);
       
       public Http10() {
           super();
  
  
  
  1.15      +5 -5      jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Http10Interceptor.java
  
  Index: Http10Interceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Http10Interceptor.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Http10Interceptor.java	2001/02/20 03:16:53	1.14
  +++ Http10Interceptor.java	2001/03/02 04:49:25	1.15
  @@ -147,14 +147,14 @@
   	catch(java.net.SocketException e) {
   	    // SocketExceptions are normal
   	    log( "SocketException reading request, ignored", null,
  -		 Logger.INFORMATION);
  -	    log( "SocketException reading request:", e, Logger.DEBUG);
  +		 Log.INFORMATION);
  +	    log( "SocketException reading request:", e, Log.DEBUG);
   	}
   	catch (java.io.IOException e) {
   	    // IOExceptions are normal 
   	    log( "IOException reading request, ignored", null,
  -		 Logger.INFORMATION);
  -	    log( "IOException reading request:", e, Logger.DEBUG);
  +		 Log.INFORMATION);
  +	    log( "IOException reading request:", e, Log.DEBUG);
   	}
   	// Future developers: if you discover any other
   	// rare-but-nonfatal exceptions, catch them here, and log as
  @@ -164,7 +164,7 @@
   	    // with "ERROR" level, so it will show up even on
   	    // less-than-verbose logs.
   	    e.printStackTrace();
  -	    log( "Error reading request, ignored", e, Logger.ERROR);
  +	    log( "Error reading request, ignored", e, Log.ERROR);
   	} 
   	finally {
   	    // recycle kernel sockets ASAP
  
  
  
  1.11      +1 -1      jakarta-tomcat/src/share/org/apache/tomcat/modules/session/SimpleSessionStore.java
  
  Index: SimpleSessionStore.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/session/SimpleSessionStore.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- SimpleSessionStore.java	2001/02/28 20:38:58	1.10
  +++ SimpleSessionStore.java	2001/03/02 04:49:31	1.11
  @@ -300,7 +300,7 @@
    */
   class SimpleSessionManager  
   {
  -    protected Log loghelper = new Log("tc_log", this);
  +    protected Log loghelper = Log.getLog("tc_log", this);
       
       /** The set of previously recycled Sessions for this Manager.
        */
  
  
  
  1.58      +4 -5      jakarta-tomcat/src/share/org/apache/tomcat/startup/Tomcat.java
  
  Index: Tomcat.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/Tomcat.java,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- Tomcat.java	2001/02/20 03:17:57	1.57
  +++ Tomcat.java	2001/03/02 04:49:34	1.58
  @@ -21,7 +21,7 @@
    *
    * @author costin@dnt.ro
    */
  -public class Tomcat extends Log {
  +public class Tomcat {
   
       private static StringManager sm =
   	StringManager.getManager("org.apache.tomcat.resources");
  @@ -38,9 +38,9 @@
       // relative to TOMCAT_HOME
       static final String DEFAULT_CONFIG="conf/server.xml";
       SimpleHashtable attributes=new SimpleHashtable();;
  -
  +    static Log log=Log.getLog( "tc_log", "Tomcat" );
  +    
       public Tomcat() {
  -	super("tc_log");
       }
       //-------------------- Properties --------------------
       
  @@ -72,8 +72,7 @@
   	    tomcat.setArgs( args );
               tomcat.execute();
   	} catch(Exception ex ) {
  -	    System.out.println(sm.getString("tomcat.fatal"));
  -	    System.err.println(Logger.throwableToString(ex));
  +	    log.log(sm.getString("tomcat.fatal"), ex);
   	    System.exit(1);
   	}
       }
  
  
  

Mime
View raw message