jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1547446 [2/2] - in /jena/branches/jena-fuseki-new-ui/src/main/java/org/apache/jena/fuseki: ./ mgt/ servlets/ validation/
Date Tue, 03 Dec 2013 15:53:36 GMT
Modified: jena/branches/jena-fuseki-new-ui/src/main/java/org/apache/jena/fuseki/validation/ValidationAction.java
URL: http://svn.apache.org/viewvc/jena/branches/jena-fuseki-new-ui/src/main/java/org/apache/jena/fuseki/validation/ValidationAction.java?rev=1547446&r1=1547445&r2=1547446&view=diff
==============================================================================
--- jena/branches/jena-fuseki-new-ui/src/main/java/org/apache/jena/fuseki/validation/ValidationAction.java
(original)
+++ jena/branches/jena-fuseki-new-ui/src/main/java/org/apache/jena/fuseki/validation/ValidationAction.java
Tue Dec  3 15:53:35 2013
@@ -25,11 +25,13 @@ import javax.servlet.http.HttpServletReq
 import javax.servlet.http.HttpServletResponse ;
 
 import org.apache.jena.atlas.logging.Log ;
+import org.slf4j.Logger ;
 
 public class ValidationAction
 {
     public final boolean verbose ;
     public final long id ;
+    public final Logger log ;
     private boolean startTimeIsSet = false ;
     private boolean finishTimeIsSet = false ;
 
@@ -46,8 +48,9 @@ public class ValidationAction
     public HttpServletRequest request;
     public HttpServletResponse response ;
     
-    public ValidationAction(long id, HttpServletRequest request, HttpServletResponse response,
boolean verbose) {
+    public ValidationAction(long id, Logger log, HttpServletRequest request, HttpServletResponse
response, boolean verbose) {
         this.id = id ;
+        this.log = log ;
         this.request = request ;
         this.response = response ;
         this.verbose = false ;

Modified: jena/branches/jena-fuseki-new-ui/src/main/java/org/apache/jena/fuseki/validation/ValidatorBaseJson.java
URL: http://svn.apache.org/viewvc/jena/branches/jena-fuseki-new-ui/src/main/java/org/apache/jena/fuseki/validation/ValidatorBaseJson.java?rev=1547446&r1=1547445&r2=1547446&view=diff
==============================================================================
--- jena/branches/jena-fuseki-new-ui/src/main/java/org/apache/jena/fuseki/validation/ValidatorBaseJson.java
(original)
+++ jena/branches/jena-fuseki-new-ui/src/main/java/org/apache/jena/fuseki/validation/ValidatorBaseJson.java
Tue Dec  3 15:53:35 2013
@@ -42,6 +42,7 @@ import com.hp.hpl.jena.sparql.util.Conte
 /** ValidationBase for JSON out */ 
 public abstract class ValidatorBaseJson extends ServletBase
 {
+    private static Logger vLog = Fuseki.validationLog ;
     public static final String jErrors          = "errors" ;
     public static final String jWarnings        = "warning" ;
 
@@ -62,7 +63,7 @@ public abstract class ValidatorBaseJson 
     
     protected void execute(HttpServletRequest request, HttpServletResponse response) {
         long id = allocRequestId(request, response) ;
-        ValidationAction action = new ValidationAction(id, request, response, false) ;
+        ValidationAction action = new ValidationAction(id, vLog, request, response, false)
;
         printRequest(action) ;
         action.setStartTime() ;
         
@@ -108,17 +109,17 @@ public abstract class ValidatorBaseJson 
         String url = wholeRequestURL(action.request) ;
         String method = action.request.getMethod() ;
 
-        log.info(format("[%d] %s %s", action.id, method, url)) ;
+        action.log.info(format("[%d] %s %s", action.id, method, url)) ;
         if ( action.verbose ) {
             Enumeration<String> en = action.request.getHeaderNames() ;
             for (; en.hasMoreElements();) {
                 String h = en.nextElement() ;
                 Enumeration<String> vals = action.request.getHeaders(h) ;
                 if (!vals.hasMoreElements())
-                    log.info(format("[%d]   ", action.id, h)) ;
+                    action.log.info(format("[%d]   ", action.id, h)) ;
                 else {
                     for (; vals.hasMoreElements();)
-                        log.info(format("[%d]   %-20s %s", action.id, h, vals.nextElement()))
;
+                        action.log.info(format("[%d]   %-20s %s", action.id, h, vals.nextElement()))
;
                 }
             }
         }
@@ -142,9 +143,9 @@ public abstract class ValidatorBaseJson 
         String timeStr = fmtMillis(time) ;
 
         if ( action.message == null )
-            log.info(String.format("[%d] %d %s (%s) ", action.id, action.statusCode, HttpSC.getMessage(action.statusCode),
timeStr)) ;
+            action.log.info(String.format("[%d] %d %s (%s) ", action.id, action.statusCode,
HttpSC.getMessage(action.statusCode), timeStr)) ;
         else
-            log.info(String.format("[%d] %d %s (%s) ", action.id, action.statusCode, action.message,
timeStr)) ;
+            action.log.info(String.format("[%d] %d %s (%s) ", action.id, action.statusCode,
action.message, timeStr)) ;
     }
     
     private static String fmtMillis(long time)



Mime
View raw message