You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by ch...@apache.org on 2015/01/19 19:33:12 UTC
svn commit: r1653070 - in /uima/sandbox/uima-ducc/trunk:
src/main/admin/ducc_util.py
uima-ducc-common/src/main/java/org/apache/uima/ducc/common/utils/DuccLogger.java
Author: challngr
Date: Mon Jan 19 18:33:12 2015
New Revision: 1653070
URL: http://svn.apache.org/r1653070
Log:
UIMA-4186 Use log4j API, not classpath, to configure logger.
Modified:
uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_util.py
uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/utils/DuccLogger.java
Modified: uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_util.py
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_util.py?rev=1653070&r1=1653069&r2=1653070&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_util.py (original)
+++ uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_util.py Mon Jan 19 18:33:12 2015
@@ -246,7 +246,7 @@ class DuccUtil(DuccBase):
CLASSPATH = CLASSPATH + ':' + LIB + 'libpam4j/*'
CLASSPATH = CLASSPATH + ':' + LIB + 'uima-ducc/*'
- CLASSPATH = CLASSPATH + ':' + DH + 'resources'
+ # CLASSPATH = CLASSPATH + ':' + DH + 'resources' UIMA-4168 Use API, not classpath to configure log4j
# more are added to some components in ducc.py, e.g.
# derby, apache-activemq/lib/optional, jetty from ws lib, jsp, http- client
Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/utils/DuccLogger.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/utils/DuccLogger.java?rev=1653070&r1=1653069&r2=1653070&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/utils/DuccLogger.java (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/utils/DuccLogger.java Mon Jan 19 18:33:12 2015
@@ -31,6 +31,7 @@ import org.apache.log4j.Logger;
import org.apache.log4j.MDC;
import org.apache.log4j.spi.ErrorHandler;
import org.apache.log4j.spi.LoggingEvent;
+import org.apache.log4j.xml.DOMConfigurator;
import org.apache.uima.ducc.common.utils.id.DuccId;
@@ -140,6 +141,14 @@ public class DuccLogger
{
// initLogger();
+ // UIMA-4186, use log4j API for configuration
+ String ducc_home = System.getProperty("DUCC_HOME");
+ if ( ducc_home == null ) {
+ System.out.println("WARNING: Cannot find system proeprty DUCC_HOME to configure ducc logger. Using defualt log4j configurator.");
+ } else {
+ DOMConfigurator.configureAndWatch(System.getProperty("DUCC_HOME") + "/resources/log4j.xml");
+ }
+
//
// Try to set component from calling thread if not set.
//