jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [2/2] git commit: NCSA request logging
Date Sat, 25 Oct 2014 16:15:05 GMT
NCSA request logging

Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/dee9df51
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/dee9df51
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/dee9df51

Branch: refs/heads/master
Commit: dee9df5109c259bf41275dafaf10f8ce016400d0
Parents: cd601a4
Author: Andy Seaborne <andy@apache.org>
Authored: Sat Oct 25 17:14:52 2014 +0100
Committer: Andy Seaborne <andy@apache.org>
Committed: Sat Oct 25 17:14:52 2014 +0100

----------------------------------------------------------------------
 .../java/org/apache/jena/fuseki/Fuseki.java     |  2 +-
 .../java/org/apache/jena/fuseki/FusekiCmd.java  |  1 -
 .../org/apache/jena/fuseki/FusekiLogging.java   | 32 ++++++++++++++++----
 .../apache/jena/fuseki/jetty/JettyFuseki.java   |  4 +--
 4 files changed, 28 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/dee9df51/jena-fuseki2/src/main/java/org/apache/jena/fuseki/Fuseki.java
----------------------------------------------------------------------
diff --git a/jena-fuseki2/src/main/java/org/apache/jena/fuseki/Fuseki.java b/jena-fuseki2/src/main/java/org/apache/jena/fuseki/Fuseki.java
index b2f4e05..701fb20 100644
--- a/jena-fuseki2/src/main/java/org/apache/jena/fuseki/Fuseki.java
+++ b/jena-fuseki2/src/main/java/org/apache/jena/fuseki/Fuseki.java
@@ -134,7 +134,7 @@ public class Fuseki {
     public static final Logger        serverLog         = LoggerFactory.getLogger(serverLogName)
;
 
     /** Logger used for the servletContent.log operations (if settable -- depends on environment)
*/
-    public static final String        servletRequestLogName     = PATH + ".Request" ;
+    public static final String        servletRequestLogName     = PATH + ".Servlet" ;
 
     /** Actual log file for config server messages. */
     public static final String        configLogName     = PATH + ".Config" ;

http://git-wip-us.apache.org/repos/asf/jena/blob/dee9df51/jena-fuseki2/src/main/java/org/apache/jena/fuseki/FusekiCmd.java
----------------------------------------------------------------------
diff --git a/jena-fuseki2/src/main/java/org/apache/jena/fuseki/FusekiCmd.java b/jena-fuseki2/src/main/java/org/apache/jena/fuseki/FusekiCmd.java
index 745d430..7ac8b1d 100644
--- a/jena-fuseki2/src/main/java/org/apache/jena/fuseki/FusekiCmd.java
+++ b/jena-fuseki2/src/main/java/org/apache/jena/fuseki/FusekiCmd.java
@@ -318,7 +318,6 @@ public class FusekiCmd {
 
         @Override
         protected void exec() {
-            //*************
             FusekiServletContextListener.initialSetup = cmdLineDataset ;
             // For standalone, command line use ...
             JettyFuseki.initializeServer(jettyServerConfig) ;

http://git-wip-us.apache.org/repos/asf/jena/blob/dee9df51/jena-fuseki2/src/main/java/org/apache/jena/fuseki/FusekiLogging.java
----------------------------------------------------------------------
diff --git a/jena-fuseki2/src/main/java/org/apache/jena/fuseki/FusekiLogging.java b/jena-fuseki2/src/main/java/org/apache/jena/fuseki/FusekiLogging.java
index 570e8e5..badaeab 100644
--- a/jena-fuseki2/src/main/java/org/apache/jena/fuseki/FusekiLogging.java
+++ b/jena-fuseki2/src/main/java/org/apache/jena/fuseki/FusekiLogging.java
@@ -80,37 +80,57 @@ public class FusekiLogging
     // 3/ Use log4j.properties on the classpath.
     // 4/ Use Built in.
 
+    private static boolean LogLogging = false ;
+    
     public static void setLogging() {
+        if ( LogLogging )
+            System.err.println("Fuseki logging") ;
         // No loggers have been created but configuration may have been set up.
         String x = System.getProperty("log4j.configuration", null) ;
+        if ( LogLogging )
+            System.err.println("log4j.configuration = " + x) ;
 
-        if ( x != null && !x.equals("set") )
+        if ( x != null ) // && !x.equals("set") )
+            // Punt to log4j proper, or maybe already set.
             // "set" indicates that logging was set before.
             return ;
-
-        // Look for a log4j.properties in the current working directory for easy customization.
+        if ( LogLogging )
+            System.err.println("Fuseki logging - setup") ;
+        // Look for a log4j.properties in the current working directory for easy
+        // customization.
         try {
+            if ( LogLogging )
+                System.err.println("Fuseki logging - look for local log4j.properties") ;
             String fn = "log4j.properties" ;
             File f = new File(fn) ;
             if ( f.exists() ) {
+                if ( LogLogging )
+                    System.err.println("Fuseki logging - found file:log4j.properties") ;
                 PropertyConfigurator.configure(fn) ;
                 System.setProperty("log4j.configuration", "file:" + fn) ;
                 return ;
             }
-        } catch (Throwable th) {}
-        
+            if ( LogLogging )
+                System.err.println("Fuseki logging - no local log4j.properties") ;
+        }
+        catch (Throwable th) {}
+
         // Try log4j.properties
 
         // The log4j general is initialization done in a class static
         // in LogManager so it can't be called again in any sensible manner.
         // Instead, we include the same basic mechanism ...
+        if ( LogLogging )
+            System.err.println("Fuseki logging - look for URL log4j.properties") ;
         URL url = Loader.getResource("log4j.properties") ;
         if ( url != null ) {
-            PropertyConfigurator.configure(url);
+            PropertyConfigurator.configure(url) ;
             System.setProperty("log4j.configuration", url.toString()) ;
             return ;
         }
 
+        if ( LogLogging )
+            System.err.println("Fuseki logging - LogCtl.resetLogging") ;
         // Use builtin.
         LogCtl.resetLogging(log4Jsetup) ;
         // Stop anything attempting to do it again.

http://git-wip-us.apache.org/repos/asf/jena/blob/dee9df51/jena-fuseki2/src/main/java/org/apache/jena/fuseki/jetty/JettyFuseki.java
----------------------------------------------------------------------
diff --git a/jena-fuseki2/src/main/java/org/apache/jena/fuseki/jetty/JettyFuseki.java b/jena-fuseki2/src/main/java/org/apache/jena/fuseki/jetty/JettyFuseki.java
index e675a08..2c016e1 100644
--- a/jena-fuseki2/src/main/java/org/apache/jena/fuseki/jetty/JettyFuseki.java
+++ b/jena-fuseki2/src/main/java/org/apache/jena/fuseki/jetty/JettyFuseki.java
@@ -24,7 +24,6 @@ import static org.apache.jena.fuseki.Fuseki.serverLog ;
 import java.io.FileInputStream ;
 
 import org.apache.jena.atlas.lib.FileOps ;
-import org.apache.jena.atlas.logging.LogCtl ;
 import org.apache.jena.fuseki.Fuseki ;
 import org.apache.jena.fuseki.FusekiException ;
 import org.apache.jena.fuseki.mgt.MgtJMX ;
@@ -189,8 +188,6 @@ public class JettyFuseki {
       // which happens during server startup. 
       // This the name of the ServletContext logger as well
       webapp.setDisplayName(Fuseki.servletRequestLogName);  
-      LogCtl.set(Fuseki.servletRequestLogName, "WARN"); 
-      
       webapp.setParentLoaderPriority(true);  // Normal Java classloader behaviour.
       webapp.setErrorHandler(new FusekiErrorHandler()) ;
       return webapp ;
@@ -203,6 +200,7 @@ public class JettyFuseki {
             configServer(jettyConfig) ;
         else
             defaultServerConfig(serverConfig.port, serverConfig.loopback) ;
+
         WebAppContext webapp = createWebApp(contextPath) ;
         server.setHandler(webapp) ;
         // Replaced by Shiro.


Mime
View raw message