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, 16 Mar 2005 16:38:04 GMT
ate         2005/03/16 08:38:04

  Modified:    portal/src/java/org/apache/jetspeed/engine Tag:
                        deployment-refactoring AbstractEngine.java
  Added:       portal/src/java/org/apache/jetspeed/util Tag:
                        deployment-refactoring IsolatedLog4JLogger.java
  Log:
  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
  No                   revision
  No                   revision
  1.1.2.1   +244 -0    jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/util/Attic/IsolatedLog4JLogger.java
  
  
  
  
  No                   revision
  No                   revision
  1.14.2.2  +9 -4      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.2.1
  retrieving revision 1.14.2.2
  diff -u -r1.14.2.1 -r1.14.2.2
  --- AbstractEngine.java	2 Mar 2005 02:46:28 -0000	1.14.2.1
  +++ AbstractEngine.java	16 Mar 2005 16:38:04 -0000	1.14.2.2
  @@ -36,8 +36,11 @@
   import org.apache.jetspeed.pipeline.Pipeline;
   import org.apache.jetspeed.request.RequestContext;
   import org.apache.jetspeed.request.RequestContextComponent;
  -import org.apache.log4j.LogManager;
  +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;
  @@ -124,8 +127,10 @@
               Properties p = new Properties();
               p.load(new FileInputStream(log4jFile));
               p.setProperty(APPLICATION_ROOT_KEY, context.getApplicationRoot());
  -            LogManager.resetConfiguration();
  -            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