portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject cvs commit: jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/engine AbstractEngine.java
Date Wed, 23 Mar 2005 22:50:44 GMT
ate         2005/03/23 14:50:44

  Modified:    portal/src/java/org/apache/jetspeed/engine
                        AbstractEngine.java
  Added:       portal/src/java commons-logging.properties
               portal/src/java/org/apache/jetspeed/util
                        IsolatedLog4JLogger.java
  Log:
  Resolving http://issues.apache.org/jira/browse/JS2-210:
  Encapsulated Log4JLogging configuration to make it more independant of how different web/application
servers provide commons-logging and Log4J jars.
  On JBoss, those are provided (and enforced) from a shared classloader, resulting in a very
problematic logging configuration.
  The new IsolatedLog4JLogger handles this problem by ensuring Log4J logging is always done
CurrentContextClassLoader relative.
  See the javadoc for a complete description.
  
  Revision  Changes    Path
  1.2       +1 -0      jakarta-jetspeed-2/portal/src/java/commons-logging.properties
  
  
  
  
  1.2       +244 -0    jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/util/IsolatedLog4JLogger.java
  
  
  
  
  1.15      +9 -2      jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/engine/AbstractEngine.java
  
  Index: AbstractEngine.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/engine/AbstractEngine.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- AbstractEngine.java	5 Jan 2005 15:44:34 -0000	1.14
  +++ AbstractEngine.java	23 Mar 2005 22:50:44 -0000	1.15
  @@ -36,7 +36,11 @@
   import org.apache.jetspeed.pipeline.Pipeline;
   import org.apache.jetspeed.request.RequestContext;
   import org.apache.jetspeed.request.RequestContextComponent;
  +import org.apache.jetspeed.util.IsolatedLog4JLogger;
  +import org.apache.log4j.Hierarchy;
  +import org.apache.log4j.Level;
   import org.apache.log4j.PropertyConfigurator;
  +import org.apache.log4j.spi.RootCategory;
   import org.apache.ojb.broker.util.ClassHelper;
   import org.apache.pluto.PortletContainer;
   import org.apache.pluto.PortletContainerException;
  @@ -123,7 +127,10 @@
               Properties p = new Properties();
               p.load(new FileInputStream(log4jFile));
               p.setProperty(APPLICATION_ROOT_KEY, context.getApplicationRoot());
  -            PropertyConfigurator.configure(p);
  +            Hierarchy h = new Hierarchy(new RootCategory(Level.INFO));
  +            new PropertyConfigurator().doConfigure(p,h);
  +            IsolatedLog4JLogger.setHierarchy(h);
  +            
               log.info("Configured log4j from " + log4jFile);
               log.info("Starting Jetspeed Engine ("+getClass().getName()+") at "+format.format(startTime));
       
  
  
  

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


Mime
View raw message