From: <sha...@us...> - 2012-04-29 17:25:52
|
Revision: 3667 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3667&view=rev Author: shadowtm Date: 2012-04-29 17:25:45 +0000 (Sun, 29 Apr 2012) Log Message: ----------- Added logger for the cli package so we could enable output of stacktraces to the appenders if we want. Modified Paths: -------------- trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java trunk/interfaces/src/main/resources/log4j.properties Modified: trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java 2012-04-29 16:25:14 UTC (rev 3666) +++ trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java 2012-04-29 17:25:45 UTC (rev 3667) @@ -28,7 +28,6 @@ import java.util.Map.Entry; import org.apache.commons.lang.exception.ExceptionUtils; -import org.apache.log4j.Logger; import org.apache.xmlbeans.XmlObject; import org.dllearner.configuration.IConfiguration; import org.dllearner.configuration.spring.ApplicationContextBuilder; @@ -39,6 +38,8 @@ import org.dllearner.core.*; import org.dllearner.learningproblems.PosNegLP; import org.dllearner.utilities.Files; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.context.ApplicationContext; import org.springframework.core.io.FileSystemResource; import org.springframework.core.io.Resource; @@ -52,9 +53,8 @@ */ public class CLI { - private static Logger logger = Logger.getLogger(CLI.class); - private static Logger rootLogger = Logger.getRootLogger(); - + private static Logger logger = LoggerFactory.getLogger(CLI.class); + private ApplicationContext context; private IConfiguration configuration; private File confFile; @@ -190,7 +190,7 @@ // Get the Root Error Message logger.error("An Error Has Occurred During Processing."); logger.error(primaryCause.getMessage()); - + logger.debug("Stack Trace: ", e); logger.error("Terminating DL-Learner...and writing stacktrace to: " + stacktraceFileName); FileOutputStream fos = new FileOutputStream(stacktraceFileName); PrintStream ps = new PrintStream(fos); Modified: trunk/interfaces/src/main/resources/log4j.properties =================================================================== --- trunk/interfaces/src/main/resources/log4j.properties 2012-04-29 16:25:14 UTC (rev 3666) +++ trunk/interfaces/src/main/resources/log4j.properties 2012-04-29 17:25:45 UTC (rev 3667) @@ -1,3 +1,5 @@ +# All loggers will default to the INFO level unless specified in a specific logger +# For more information, see the Log4J API manual at: http://bit.ly/KmvtWL . log4j.rootLogger=INFO, stdout, file log4j.appender.stdout=org.apache.log4j.ConsoleAppender @@ -12,6 +14,8 @@ # DL-Learner Logs log4j.logger.org.dllearner=INFO +# Turn this to Debug if you wish to dump stack traces to the appenders (console, file) +log4j.logger.org.dllearner.cli=INFO log4j.logger.org.dllearner.server.nke.LogicalRelationStrategy=DEBUG log4j.category.org.dllearner.kb.simple=DEBUG This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |