costin      01/01/31 22:08:48

  Modified:    src/etc  server.xml
               src/share/org/apache/tomcat/modules/config LogSetter.java
  Log:
  Replaced <Logger> with the LogSetter, now everything works the same way
  without any special hacks.
  
  The comments on logging moved to the LogSetter - I'll also migrate
  more of the comments from server.xml to the modules.
  The idea is that module documentation ( that should be located in
  modules themself - or in the user documentation ) should be part of
  the docs, not in xml comments. server.xml might get re-generated by
  tools and the comments are hard to preserve.
  
  We can add an explicit description="..." to each module, to explain
  what it's doing, but I don't think server.xml is the right user documentation
  
  ( if we decide to use it as user doc, we should add comments for all
  modules )
  
  ( also fixed the class name in LogSetter - bad commit )
  
  Revision  Changes    Path
  1.64      +27 -97    jakarta-tomcat/src/etc/server.xml
  
  Index: server.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/etc/server.xml,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- server.xml        2001/01/28 21:30:35     1.63
  +++ server.xml        2001/02/01 06:08:48     1.64
  @@ -1,88 +1,5 @@
   <?xml version="1.0" encoding="ISO-8859-1"?>
  -<!-- 
  -<!DOCTYPE Server SYSTEM "server.dtd" >
  --->
  -
   <Server>
  -  <!-- Debug low-level events in XmlMapper startup 
  -    <xmlmapper:debug level="0" />
  -  -->
  -
  -  <!-- 
  -  
  -    Logging:
  -
  -         Logging in Tomcat is quite flexible; we can either have a log
  -         file per module (example: ContextManager) or we can have one
  -         for Servlets and one for Jasper, or we can just have one
  -         tomcat.log for both Servlet and Jasper.  Right now there are
  -         three standard log streams, "tc_log", "servlet_log", and
  -         "JASPER_LOG".  
  -
  -      Path: 
  -
  -      The file to which to output this log, relative to
  -      TOMCAT_HOME.  If you omit a "path" value, then stderr or
  -      stdout will be used.
  -
  -      Verbosity: 
  -
  -      Threshold for which types of messages are displayed in the
  -      log.  Levels are inclusive; that is, "WARNING" level displays
  -      any log message marked as warning, error, or fatal.  Default
  -      level is WARNING.  Note: servlet_log must be level
  -      INFORMATION in order to see normal servlet log messages.
  -
  -      verbosityLevel values can be: 
  -         FATAL
  -         ERROR
  -         WARNING 
  -            INFORMATION
  -            DEBUG
  -
  -      Timestamps:
  -
  -      By default, logs print a timestamp in the form "yyyy-MM-dd
  -      hh:mm:ss" in front of each message.  To disable timestamps
  -      completely, set 'timestamp="no"'. To use the raw
  -      msec-since-epoch, which is more efficient, set
  -      'timestampFormat="msec"'.  If you want a custom format, you
  -      can use 'timestampFormat="hh:mm:ss"' following the syntax of
  -      java.text.SimpleDateFormat (see Javadoc API).  For a
  -      production environment, we recommend turning timestamps off,
  -      or setting the format to "msec".
  -
  -      Custom Output:
  -
  -      "Custom" means "normal looking".  "Non-custom" means
  -      "surrounded with funny xml tags".  In preparation for
  -      possibly disposing of "custom" altogether, now the default is
  -      'custom="yes"' (i.e. no tags)
  -
  -      Per-component Debugging:
  -
  -      Some components accept a "debug" attribute.  This further
  -      enhances log output.  If you set the "debug" level for a
  -      component, it may output extra debugging information.
  -    -->
  -
  -    <!-- if you don't want messages on screen, add the attribute
  -            path="logs/tomcat.log" 
  -      to the Logger element below
  -    -->
  -    <Logger name="tc_log" 
  -            verbosityLevel = "INFORMATION" 
  -    />
  -
  -    <Logger name="servlet_log" 
  -            path="logs/servlet-${yyyyMMdd}.log"
  -            verbosityLevel = "INFORMATION" 
  -    />
  -
  -    <Logger name="JASPER_LOG" 
  -         path="logs/jasper-${yyyyMMdd}.log"
  -            verbosityLevel = "INFORMATION" 
  -    />
   
       <!-- You can add a "home" attribute to represent the "base" for 
            all relative paths. If none is set, the TOMCAT_HOME property
  @@ -98,8 +15,21 @@
       <ContextManager debug="0" workDir="work" >
   
         <!-- ==================== Interceptors ==================== -->
  -        <ContextInterceptor 
  -            className="org.apache.tomcat.modules.config.DefaultCMSetter" />
  +
  +        <!-- no path - console output -->
  +        <ContextInterceptor  name="tc_log" 
  +            className="org.apache.tomcat.modules.config.LogSetter"
  +            verbosityLevel = "INFORMATION"  />
  +
  +        <ContextInterceptor  name="servlet_log" 
  +            className="org.apache.tomcat.modules.config.LogSetter"
  +            verbosityLevel = "INFORMATION"
  +            path="logs/servlet-${yyyyMMdd}.log" />
  +
  +        <ContextInterceptor  name="JASPER_LOG" 
  +            className="org.apache.tomcat.modules.config.LogSetter"
  +            path="logs/jasper-${yyyyMMdd}.log" />
  +            verbosityLevel = "INFORMATION"  />
   
           <!-- 
            ContextInterceptor 
  @@ -309,18 +239,18 @@
               docBase="webapps/examples" 
               debug="0" 
            reloadable="true" > 
  -           <RequestInterceptor 
  -              className="org.apache.tomcat.modules.aaa.SimpleRealm" 
  -              filename="conf/users/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" 
  -             />
  +              <RequestInterceptor 
  +                  className="org.apache.tomcat.modules.aaa.SimpleRealm" 
  +                  filename="conf/users/example-users.xml"
  +                  debug="0" />
  +              <ContextInterceptor  name="example_tc_log" 
  +                  className="org.apache.tomcat.modules.config.LogSetter"
  +                  verbosityLevel = "INFORMATION"
  +                  path="logs/examples.log" />
  +              <ContextInterceptor  name="example_servlet_log" 
  +                 className="org.apache.tomcat.modules.config.LogSetter"
  +                 verbosityLevel = "INFORMATION"
  +                 path="logs/servlet_examples.log" servletLogger="true"/>
           </Context>
   
           <!-- Admin context will use tomcat.core to add/remove/get info about
  
  
  
  1.2       +2 -2      
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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LogSetter.java    2001/02/01 05:42:59     1.1
  +++ LogSetter.java    2001/02/01 06:08:48     1.2
  @@ -123,13 +123,13 @@
     component, it may output extra debugging information.
   
    */
  -public class LoggerSetter extends  BaseInterceptor {
  +public class LogSetter extends  BaseInterceptor {
       String name;
       String path;
       String verbosityLevel;
       boolean servletLogger=false;
       
  -    public LoggerSetter() {
  +    public LogSetter() {
       }
   
       /** Set the name of the logger.
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to