tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/helper ServerXmlHelper.java
Date Fri, 29 Sep 2000 04:11:48 GMT
costin      00/09/28 21:11:48

  Modified:    .        build.xml
               src/etc  server.dtd server.xml
               src/share/org/apache/tomcat/core Context.java
               src/share/org/apache/tomcat/helper ServerXmlHelper.java
  Log:
  Finally made the big change in server.xml -> the old target is
  "tomcat-old", and it builds tomcat as it used to do before.
  
  The default target will now build tomcat based on the modules,
  each module will have it's own jar file.
  
  It is still possible to use tomcat.sh - the jars in lib/ are the
  same as before.
  
  What's special is that tomcat.jar contains a special class ( with no
  external dependency - you just need tomcat.jar in CLASSPATH and
  _nothing_ else) that will do all the things that the .sh/bat files used
  to do. It will set the classpath, start tomcat, interpret options, etc.
  You can call it with java -jar tomcat.jar ( if you use JDK1.2 )
  
  Also:
  - Few more comments in Context.
  
  - Added the dtd and xml reader configuration for per/context loggers
  ( I think Alex forgot this one )
  
  - Small fix to register the per/context logger with the context manager.
  
  Revision  Changes    Path
  1.87      +2 -0      jakarta-tomcat/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/build.xml,v
  retrieving revision 1.86
  retrieving revision 1.87
  diff -u -r1.86 -r1.87
  --- build.xml	2000/09/28 03:42:53	1.86
  +++ build.xml	2000/09/29 04:11:47	1.87
  @@ -224,6 +224,7 @@
       <jar jarfile="${tomcat.build}/lib/servlet22/facade22.jar"
         basedir="${tomcat.build}/classes" > 
         <include name="org/apache/tomcat/facade/**" /> 
  +      <include name="org/apache/tomcat/modules/facade22/**" />    
       </jar>
       <!-- Copy the file in lib/ too, for tomcat.sh use ( until this is 
            fixed for multiple facades 
  @@ -231,6 +232,7 @@
       <jar jarfile="${tomcat.build}/lib/facade22.jar"
         basedir="${tomcat.build}/classes" > 
         <include name="org/apache/tomcat/facade/**" /> 
  +      <include name="org/apache/tomcat/modules/facade22/**" />    
       </jar>
     </target>
   
  
  
  
  1.4       +14 -1     jakarta-tomcat/src/etc/server.dtd
  
  Index: server.dtd
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/etc/server.dtd,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- server.dtd	2000/09/09 23:07:53	1.3
  +++ server.dtd	2000/09/29 04:11:47	1.4
  @@ -3,6 +3,9 @@
   
   <!ELEMENT Server (Logger | ContextManager )* >
   
  +<!-- A log channel, can be set per context manager, per
  +     context or per Interceptor
  +-->
   <!ELEMENT Logger EMPTY >
   <!ATTLIST Logger
             name                CDATA #REQUIRED
  @@ -46,10 +49,20 @@
   <!ATTLIST Host
             name       CDATA #REQUIRED >
   
  -<!ELEMENT Context EMPTY >
  +<!ELEMENT Context ( Logger | ServletLogger ) >
   <!ATTLIST Context
             path       CDATA #REQUIRED
             docBase    CDATA #REQUIRED 
             reloadable CDATA #IMPLIED
             trusted    CDATA #IMPLIED
             debug      CDATA #IMPLIED >
  +
  +
  +<!-- Indicate the context's servlet logger - 
  +     where the output of servlet.log() goes 
  +-->
  +<!ELEMENT ServletLogger EMPTY >
  +<!ATTLIST ServletLogger
  +          name                CDATA #REQUIRED
  +          verbosityLevel      CDATA #IMPLIED
  +          path                CDATA #IMPLIED >
  
  
  
  1.47      +19 -10    jakarta-tomcat/src/etc/server.xml
  
  Index: server.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/etc/server.xml,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- server.xml	2000/09/28 03:25:42	1.46
  +++ server.xml	2000/09/29 04:11:47	1.47
  @@ -4,11 +4,12 @@
   -->
   
   <Server>
  -    <!-- Debug low-level events in XmlMapper startup -->
  +  <!-- Debug low-level events in XmlMapper startup 
       <xmlmapper:debug level="0" />
  +  -->
   
  -    <!-- 
  -
  +  <!-- 
  +  
       Logging:
   
            Logging in Tomcat is quite flexible; we can either have a log
  @@ -284,13 +285,21 @@
            -->
   
            <Context path="/examples" 
  -                 docBase="webapps/examples" 
  -                 debug="0" 
  -                 reloadable="true" > 
  -        <RequestInterceptor 
  -            className="org.apache.tomcat.request.SimpleRealm" 
  -            filename="conf/example-users.xml"
  -            debug="0" />
  +            docBase="webapps/examples" 
  +            debug="0" 
  +	    reloadable="true" > 
  +           <RequestInterceptor 
  +              className="org.apache.tomcat.request.SimpleRealm" 
  +              filename="conf/example-users.xml"
  +              debug="0" />
  +            <Logger name="example_tc_log" 
  +              path="logs/examples.log"
  +              verbosityLevel = "INFORMATION" 
  +             />
  +            <ServletLogger name="example_servlet_log" 
  +              path="logs/servlet_examples.log"
  +              verbosityLevel = "INFORMATION" 
  +             />
           </Context>
   
           <!-- Admin context will use tomcat.core to add/remove/get info about
  
  
  
  1.121     +32 -10    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.120
  retrieving revision 1.121
  diff -u -r1.120 -r1.121
  --- Context.java	2000/09/28 06:46:21	1.120
  +++ Context.java	2000/09/29 04:11:48	1.121
  @@ -97,7 +97,7 @@
    */
   public class Context implements LogAware {
       // Proprietary attribute names for contexts - defined
  -    // here so we can document them.
  +    // here so we can document them
   
       /** Private tomcat attribute names
        */
  @@ -111,7 +111,7 @@
       public static final String ATTRIB_PROTECTION_DOMAIN=
   	"org.apache.tomcat.protection_domain";
   
  -	/** Workdir - a place where the servlets are allowed to write
  +    /** Workdir - a place where the servlets are allowed to write
        */
       public static final String ATTRIB_WORKDIR="org.apache.tomcat.workdir";
   
  @@ -125,34 +125,35 @@
       // -------------------- internal properties
       // context "id"
       private String path = "";
  +
  +    // directory where the context files are located.
       private String docBase;
   
       // Absolute path to docBase if file-system based
  -    private String absPath; 
  +    private String absPath;
  +    
       // internal state / related objects
       private ContextManager contextM;
       private Object contextFacade;
   
  -    boolean reloadable=true; // XXX change default to false after testing
  +    boolean reloadable=true; 
   
  +    // XXX Use a better repository
       private Hashtable attributes = new Hashtable();
   
  +    // directory with write-permissions for servlets
       private File workDir;
   
  -    // Security Permissions for webapps and jsp for this context
  -    Object perms = null;
  -    Object protectionDomain;
  - 
  -    //    private RequestSecurityProvider rsProvider;
  -
       // Servlets loaded by this context( String->ServletWrapper )
       private Hashtable servlets = new Hashtable();
   
       // -------------------- from web.xml
       private Hashtable initializationParameters = new Hashtable();
  +
       // all welcome files that are added are treated as "system default"
       private boolean expectUserWelcomeFiles=false;
       private Vector welcomeFiles = new Vector();
  +    
       private Hashtable errorPages = new Hashtable();
       private String description = null;
       private boolean isDistributable = false;
  @@ -230,6 +231,13 @@
   
       public void setContextManager(ContextManager cm) {
   	contextM=cm;
  +	// let the contextmanager know about our local logger
  +	// ( and open it, adjust the path, etc )
  +	if( loghelper!=null && loghelper.getLogger() != null )
  +	    contextM.addLogger( loghelper.getLogger() );
  +	if( loghelperServlet != null &&
  +	    loghelperServlet.getLogger() != null)
  +	    contextM.addLogger( loghelperServlet.getLogger() );
       }
   
       /** The servlet API variant that will be used for requests in this
  @@ -892,7 +900,21 @@
       }
   
       public void setLogger(Logger logger) {
  +	if (loghelper == null) {
  +	    loghelper = new Logger.Helper
  +		("tc_log",
  +		 (vhost==null ? "" : vhost + ":" )  +  path);
  +	}
   	loghelper.setLogger(logger);
  +    }
  +
  +    public void setServletLogger(Logger logger) {
  +	if (loghelperServlet == null) {
  +	    loghelperServlet = new Logger.Helper
  +		("servlet_log",
  +		 (vhost==null ? "" : vhost + ":" )  +  path);
  +	}
  +	loghelperServlet.setLogger(logger);
       }
   
       public Logger.Helper getLoggerHelper() {
  
  
  
  1.4       +17 -1     jakarta-tomcat/src/share/org/apache/tomcat/helper/ServerXmlHelper.java
  
  Index: ServerXmlHelper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/helper/ServerXmlHelper.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ServerXmlHelper.java	2000/09/27 04:13:30	1.3
  +++ ServerXmlHelper.java	2000/09/29 04:11:48	1.4
  @@ -125,7 +125,7 @@
   	xh.addRule( "ContextManager/Context/RequestInterceptor",
   		    xh.addChild( "addRequestInterceptor",
   				 "org.apache.tomcat.core.BaseInterceptor"));
  -
  +	
   	// Virtual host support.
   	// Push a host object on the stack
    	xh.addRule( "ContextManager/Host", new XmlAction() {
  @@ -201,6 +201,22 @@
   	xh.addRule("Server/Logger", 
   		   xh.addChild("addLogger",
   			       "org.apache.tomcat.logging.Logger") );
  +
  +	xh.addRule("Context/Logger",
  +		   xh.objectCreate("org.apache.tomcat.logging.TomcatLogger"));
  +	xh.addRule("Context/Logger", xh.setProperties());
  +	xh.addRule("Context/Logger", 
  +		   xh.addChild("setLogger",
  +			       "org.apache.tomcat.logging.Logger") );
  +
  +	xh.addRule("Context/ServletLogger",
  +		   xh.objectCreate("org.apache.tomcat.logging.TomcatLogger"));
  +	xh.addRule("Context/ServletLogger", xh.setProperties());
  +	xh.addRule("Context/ServletLogger", 
  +		   xh.addChild("setServletLogger",
  +			       "org.apache.tomcat.logging.Logger") );
  +
  +
       }
   
       /**
  
  
  

Mime
View raw message