henning 2003/07/02 09:52:24
Modified: src/java/org/apache/turbine Turbine.java
Log:
The logging code got shuffled around until it broke. Rework it, so that no
logging messages fall out on the console
Revision Changes Path
1.45 +12 -10 jakarta-turbine-2/src/java/org/apache/turbine/Turbine.java
Index: Turbine.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/Turbine.java,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- Turbine.java 22 Jun 2003 22:31:14 -0000 1.44
+++ Turbine.java 2 Jul 2003 16:52:24 -0000 1.45
@@ -263,6 +263,12 @@
private void configure(ServletConfig config, ServletContext context)
throws Exception
{
+ //
+ // Set up Commons Logging to use the Log4J Logging
+ //
+ System.getProperties().setProperty(LogFactory.class.getName(),
+ Log4jFactory.class.getName());
+
// Set the application root. This defaults to the webapp
// context if not otherwise set. This is to allow 2.1 apps
// to be developed from CVS. This feature will carry over
@@ -346,6 +352,7 @@
confStyle = "Properties";
}
+
//
// Set up logging as soon as possible
//
@@ -354,8 +361,6 @@
log4jFile = getRealPath(log4jFile);
- log.debug("Loading Log4J configuration from " + log4jFile);
-
//
// Load the config file above into a Properties object and
// fix up the Application root
@@ -367,6 +372,10 @@
p.setProperty(APPLICATION_ROOT_KEY, getApplicationRoot());
PropertyConfigurator.configure(p);
+ //
+ // Rebuild our log object with a configured commons-logging
+ log = LogFactory.getLog(this.getClass());
+
log.info("Configured log4j from " + log4jFile);
}
catch (FileNotFoundException fnf)
@@ -375,13 +384,6 @@
+ log4jFile + ": ");
fnf.printStackTrace();
}
-
- //
- // Set up Commons Logging to use the Log4J Logging
- //
- System.getProperties().setProperty(LogFactory.class.getName(),
- Log4jFactory.class.getName());
-
// Now report our successful configuration to the world
log.info("Loaded configuration (" + confStyle + ") from " + confFile + "
(" + confPath + ")");
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]