jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1376503 - /jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/FusekiCmd.java
Date Thu, 23 Aug 2012 14:25:56 GMT
Author: andy
Date: Thu Aug 23 14:25:55 2012
New Revision: 1376503

URL: http://svn.apache.org/viewvc?rev=1376503&view=rev
Log:
Set logging to have timestamp if using default logging.

Modified:
    jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/FusekiCmd.java

Modified: jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/FusekiCmd.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/FusekiCmd.java?rev=1376503&r1=1376502&r2=1376503&view=diff
==============================================================================
--- jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/FusekiCmd.java (original)
+++ jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/FusekiCmd.java Thu Aug 23
14:25:55 2012
@@ -33,8 +33,11 @@ import org.eclipse.jetty.server.Server ;
 import org.openjena.atlas.io.IO ;
 import org.openjena.atlas.lib.FileOps ;
 import org.openjena.atlas.lib.Sink ;
+import org.openjena.atlas.lib.StrUtils ;
+import org.openjena.atlas.logging.Log ;
 import org.openjena.riot.Lang ;
 import org.openjena.riot.RiotLoader ;
+import org.openjena.riot.SysRIOT ;
 import org.openjena.riot.lang.SinkQuadsToDataset ;
 import org.openjena.riot.lang.SinkTriplesToGraph ;
 import org.slf4j.Logger ;
@@ -54,6 +57,43 @@ import com.hp.hpl.jena.tdb.TDBFactory ;
 
 public class FusekiCmd extends CmdARQ
 {
+    private static String log4Jsetup = StrUtils.strjoinNL(
+          "## Plain output to stdout"
+          , "log4j.appender.jena.plain=org.apache.log4j.ConsoleAppender"
+          , "log4j.appender.jena.plain.target=System.out"
+          , "log4j.appender.jena.plain.layout=org.apache.log4j.PatternLayout"
+          , "log4j.appender.jena.plain.layout.ConversionPattern=%d{HH:mm:ss} %-5p %m%n"
+          
+          , "## Plain output with level, to stderr"
+          , "log4j.appender.jena.plainlevel=org.apache.log4j.ConsoleAppender"
+          , "log4j.appender.jena.plainlevel.target=System.err"
+          , "log4j.appender.jena.plainlevel.layout=org.apache.log4j.PatternLayout"
+          , "log4j.appender.jena.plainlevel.layout.ConversionPattern=%d{HH:mm:ss} %-5p %m%n"
+          
+          , "## Everything"
+          , "log4j.rootLogger=INFO, jena.plain"
+          , "log4j.logger.com.hp.hpl.jena=WARN"
+          , "log4j.logger.org.openjena=WARN"
+          , "log4j.logger.org.apache.jena=WARN"
+          
+          , "# Server log."
+          , "log4j.logger.org.apache.jena.fuseki.Server=INFO"
+          , "# Request log."
+          , "log4j.logger.org.apache.jena.fuseki.Fuseki=INFO"
+          , "log4j.logger.org.apache.jena.tdb.loader=INFO"
+          
+          , "## Parser output"
+          , "log4j.additivity."+SysRIOT.riotLoggerName+"=false"
+          , "log4j.logger."+SysRIOT.riotLoggerName+"=INFO, jena.plainlevel "
+        ) ;
+
+    
+    static {
+        // Check if default command logging.
+        if ( "set".equals(System.getProperty("log4j.configuration", "set") ) )
+            Log.resetLogging(log4Jsetup) ; 
+    }
+    
     // Arguments:
     // --update
     



Mime
View raw message