From ed253ceaa733c8a2b26ce81056889cb3d2f45c18 Mon Sep 17 00:00:00 2001 From: Gianpaolo Coro Date: Wed, 10 Jul 2013 16:11:32 +0000 Subject: [PATCH] git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/EcologicalEngine@78912 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../lexicalmatcher/utils/AnalysisLogger.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/gcube/contentmanagement/lexicalmatcher/utils/AnalysisLogger.java b/src/main/java/org/gcube/contentmanagement/lexicalmatcher/utils/AnalysisLogger.java index a431ffe..f691442 100644 --- a/src/main/java/org/gcube/contentmanagement/lexicalmatcher/utils/AnalysisLogger.java +++ b/src/main/java/org/gcube/contentmanagement/lexicalmatcher/utils/AnalysisLogger.java @@ -8,6 +8,7 @@ import java.util.Properties; import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.apache.log4j.PropertyConfigurator; +import org.apache.log4j.spi.RootLogger; public class AnalysisLogger { @@ -21,7 +22,7 @@ public class AnalysisLogger { org.apache.log4j.BasicConfigurator.configure(); // logger = Logger.getLogger("ConsoleAppender"); logger = Logger.getRootLogger(); - logger.setLevel(Level.INFO); + logger.setLevel(Level.TRACE); } return logger; @@ -29,7 +30,9 @@ public class AnalysisLogger { // in ingresso vuole il path al file di config del log4j public static void setLogger(String path) { - if (logger == null) { + + if (logger == null || (logger instanceof RootLogger)) { + System.out.println("EcologicalEnginLibrary: setting logger to "+path); File f = new File(path); if (f.exists()) PropertyConfigurator.configure(path); @@ -40,12 +43,14 @@ public class AnalysisLogger { p.load(is); is.close(); } catch (IOException e1) { + System.out.println("EcologicalEnginLibrary: Error in reading file"+path+" : "+e1.getLocalizedMessage()); } PropertyConfigurator.configure(p); } } logger = Logger.getLogger("AnalysisLogger"); hibernateLogger = Logger.getLogger("hibernate"); + } public static void printStackTrace(Exception e) {