2006/unicorn/src/org/w3c/unicorn Framework.java,1.13,1.14

Update of /sources/public/2006/unicorn/src/org/w3c/unicorn
In directory hutz:/tmp/cvs-serv28404/src/org/w3c/unicorn

Modified Files:
	Framework.java 
Log Message:
cleanup log4j initialization

Index: Framework.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/Framework.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- Framework.java	23 Sep 2009 12:57:28 -0000	1.13
+++ Framework.java	24 Sep 2009 17:37:53 -0000	1.14
@@ -1,5 +1,5 @@
 // $Id$
-// Author: Damien LEROY.
+// Author: Damien LEROY & Thomas GAMBET.
 // (c) COPYRIGHT MIT, ERCIM ant Keio, 2006.
 // Please first read the full copyright statement in file COPYRIGHT.html
 package org.w3c.unicorn;
@@ -50,7 +50,7 @@
 /**
  * Main class of the central module of UniCORN.
  * 
- * @author Damien LEROY
+ * @author Damien LEROY & Thomas GAMBET
  */
 public class Framework {
 
@@ -147,25 +147,17 @@
 		}
 		
 		// Log4j initialization attempt
-		//String log4jPath = unicornHome.getPath() + "/WEB-INF/conf/log4j.properties";
 		String log4jPath = unicornHome.getPath() + "/WEB-INF/conf/log4j.xml";
-		//try {
-			//loadConfigFile(log4jPath, true);
-			//PropertyConfigurator.configure(unicornPropertiesFiles.get("log4j.properties"));
+		File log4jFile = new File(log4jPath);
+		if (log4jFile.exists()) {
 			DOMConfigurator.configure(log4jPath);
 			logger.info("OK - JVM parameter \"unicorn.home\" was found: " + unicornHome.getPath());
 			logger.info("OK - Log4j successfully initialized");
 			logger.debug("> Used log4j.properties file: " + log4jPath);
-			
-			//logger.debug("> Used log4j.properties file: " + log4jPath);
-			//logger.debug("> log4j.properties:" + (UCNProperties) unicornPropertiesFiles.get("log4j.properties")); // already logged by loadConfigFile()
-		/*} catch (FileNotFoundException e) {
+		} else {
 			logger.warn("Log4j config file \"log4j.properties\" could not be found: " + log4jPath);
 			logger.warn("Log4j will not be initialized");
-		} catch (IOException e) {
-			logger.error("Error reading \"log4j.properties\": ", e);
-			logger.warn("Log4j will not be initialized");
-		}*/
+		}
 		
 	}	
 	public static void initConfig() throws InitializationFailedException {

Received on Thursday, 24 September 2009 17:38:05 UTC