tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core StandardEngine.java StandardHost.java StandardService.java
Date Mon, 27 Dec 2004 09:43:14 GMT
pero        2004/12/27 01:43:14

  Modified:    catalina/src/share/org/apache/catalina/core
                        StandardEngine.java StandardHost.java
                        StandardService.java
  Log:
  Add some log.isXXXEnabled
  
  Revision  Changes    Path
  1.28      +5 -3      jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardEngine.java
  
  Index: StandardEngine.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardEngine.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- StandardEngine.java	23 Dec 2004 06:11:51 -0000	1.27
  +++ StandardEngine.java	27 Dec 2004 09:43:14 -0000	1.28
  @@ -299,7 +299,8 @@
                   if (domain==null) {
                       domain=getName();
                   }
  -                log.debug( "Register " + domain );
  +                if(log.isDebugEnabled())
  +                    log.debug( "Register " + domain );
                   oname=new ObjectName(domain + ":type=Engine");
                   controller=oname;
                   Registry.getRegistry(null, null)
  @@ -424,7 +425,8 @@
               
           // Log our server identification information
           //System.out.println(ServerInfo.getServerInfo());
  -        log.info( "Starting Servlet Engine: " + ServerInfo.getServerInfo());
  +        if(log.isInfoEnabled())
  +            log.info( "Starting Servlet Engine: " + ServerInfo.getServerInfo());
           if( mbeans != null ) {
               try {
                   Registry.getRegistry(null, null)
  
  
  
  1.37      +13 -11    jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java
  
  Index: StandardHost.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- StandardHost.java	23 Dec 2004 06:11:51 -0000	1.36
  +++ StandardHost.java	27 Dec 2004 09:43:14 -0000	1.37
  @@ -710,12 +710,12 @@
                        errorReportValveClass));
               }
           }
  -
  -        if (xmlValidation)
  -            log.info( sm.getString("standardHost.validationEnabled"));
  -        else
  -            log.info( sm.getString("standardHost.validationDisabled"));
  -
  +        if(log.isInfoEnabled()) {
  +            if (xmlValidation)
  +                log.info( sm.getString("standardHost.validationEnabled"));
  +            else
  +                log.info( sm.getString("standardHost.validationDisabled"));
  +        }
           super.start();
   
       }
  @@ -762,13 +762,14 @@
                   HostConfig deployer = new HostConfig();
                   addLifecycleListener(deployer);                
                   if( mserver.isRegistered( serviceName )) {
  -                    log.debug("Registering with the Engine");
  +                    if(log.isDebugEnabled())
  +                        log.debug("Registering "+ serviceName +" with the Engine");
                       mserver.invoke( serviceName, "addChild",
                               new Object[] { this },
                               new String[] { "org.apache.catalina.Container" } );
                   }
               } catch( Exception ex ) {
  -                ex.printStackTrace();
  +                log.error("Host registering failed!",ex);
               }
           }
           
  @@ -777,13 +778,14 @@
               try {
                   StandardEngine engine=(StandardEngine)parent;
                   domain=engine.getName();
  -                log.debug( "Register " + domain );
  +                if(log.isDebugEnabled())
  +                    log.debug( "Register host " + getName() + " with domain "+ domain );
                   oname=new ObjectName(domain + ":type=Host,host=" +
                           this.getName());
                   Registry.getRegistry(null, null)
                       .registerComponent(this, oname, null);
               } catch( Throwable t ) {
  -                log.info("Error registering ", t );
  +                log.error("Host registering failed!", t );
               }
           }
       }
  
  
  
  1.16      +8 -7      jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardService.java
  
  Index: StandardService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardService.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- StandardService.java	23 Jun 2004 16:59:41 -0000	1.15
  +++ StandardService.java	27 Dec 2004 09:43:14 -0000	1.16
  @@ -429,7 +429,7 @@
       public void start() throws LifecycleException {
   
           // Validate and update our current component state
  -        if (started) {
  +        if (log.isInfoEnabled() && started) {
               log.info(sm.getString("standardService.start.started"));
           }
           
  @@ -438,8 +438,8 @@
   
           // Notify our interested LifecycleListeners
           lifecycle.fireLifecycleEvent(BEFORE_START_EVENT, null);
  -
  -        log.info(sm.getString("standardService.start.name", this.name));
  +        if(log.isInfoEnabled())
  +            log.info(sm.getString("standardService.start.name", this.name));
           lifecycle.fireLifecycleEvent(START_EVENT, null);
           started = true;
   
  @@ -500,9 +500,9 @@
           }
   
           lifecycle.fireLifecycleEvent(STOP_EVENT, null);
  -
  -        log.info
  -            (sm.getString("standardService.stop.name", this.name));
  +        if(log.isInfoEnabled())
  +            log.info
  +                (sm.getString("standardService.stop.name", this.name));
           started = false;
   
           // Stop our defined Container second
  @@ -545,7 +545,8 @@
       {
           // Service shouldn't be used with embeded, so it doesn't matter
           if (initialized) {
  -            log.info(sm.getString("standardService.initialize.initialized"));
  +            if(log.isInfoEnabled())
  +                log.info(sm.getString("standardService.initialize.initialized"));
               return;
           }
           initialized = true;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message