incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmatth...@apache.org
Subject svn commit: r1044672 - /incubator/isis/trunk/core/webserver/src/main/java/org/apache/isis/core/webserver/embedded/jetty/EmbeddedWebServerJetty.java
Date Sat, 11 Dec 2010 16:03:40 GMT
Author: rmatthews
Date: Sat Dec 11 16:03:39 2010
New Revision: 1044672

URL: http://svn.apache.org/viewvc?rev=1044672&view=rev
Log:
Added basic page access logging to in-built web server.

Modified:
    incubator/isis/trunk/core/webserver/src/main/java/org/apache/isis/core/webserver/embedded/jetty/EmbeddedWebServerJetty.java

Modified: incubator/isis/trunk/core/webserver/src/main/java/org/apache/isis/core/webserver/embedded/jetty/EmbeddedWebServerJetty.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/webserver/src/main/java/org/apache/isis/core/webserver/embedded/jetty/EmbeddedWebServerJetty.java?rev=1044672&r1=1044671&r2=1044672&view=diff
==============================================================================
--- incubator/isis/trunk/core/webserver/src/main/java/org/apache/isis/core/webserver/embedded/jetty/EmbeddedWebServerJetty.java
(original)
+++ incubator/isis/trunk/core/webserver/src/main/java/org/apache/isis/core/webserver/embedded/jetty/EmbeddedWebServerJetty.java
Sat Dec 11 16:03:39 2010
@@ -27,9 +27,11 @@ import javax.servlet.ServletContextListe
 
 import org.apache.log4j.Logger;
 import org.mortbay.jetty.Handler;
+import org.mortbay.jetty.NCSARequestLog;
 import org.mortbay.jetty.Server;
 import org.mortbay.jetty.handler.ContextHandler;
 import org.mortbay.jetty.handler.HandlerList;
+import org.mortbay.jetty.handler.RequestLogHandler;
 import org.mortbay.jetty.handler.ResourceHandler;
 import org.mortbay.jetty.servlet.FilterHolder;
 import org.mortbay.jetty.servlet.FilterMapping;
@@ -60,6 +62,10 @@ public class EmbeddedWebServerJetty exte
 
         final ContextHandler contextHandler = createContextHandler(handlers);
 
+        
+
+        
+        
         startServer(contextHandler);
     }
 
@@ -78,6 +84,16 @@ public class EmbeddedWebServerJetty exte
         // commenting out; this grabs '/' but we might want to use it ourselves, instead?
         // handlers.addHandler(new DefaultHandler());
 
+        // TODO use properties to set up
+        RequestLogHandler requestLogHandler = new RequestLogHandler();
+        handlers.addHandler(requestLogHandler);
+        NCSARequestLog requestLog = new NCSARequestLog("./logs/jetty-yyyy_mm_dd.request.log");
+        requestLog.setRetainDays(90);
+        requestLog.setAppend(true);
+        requestLog.setExtended(false);
+        requestLog.setLogTimeZone("GMT");
+        requestLogHandler.setRequestLog(requestLog);
+
         return handlers;
     }
 



Mime
View raw message