From: Loren C. <lor...@gm...> - 2010-02-10 14:45:57
|
Hello Thomas, The matching could be implemented by changing the following code in RewriteConfig.java: /* * If the URLRewrite is a ControllerForward, then test to see if there is a condition * on the server name. If there is a condition on the server name and the names do not * match, then ignore this ControllerForward. */ if (action instanceof ControllerForward) { if (serverName != null) { String controllerServerName = ((ControllerForward)action).getServerName(); if (controllerServerName != null) { if (!serverName.equalsIgnoreCase(controllerServerName)) { continue; } } } } As for the access log file, that is specified in the Jetty config file. <Ref id="RequestLog"> <Set name="requestLog"> <New id="RequestLogImpl" class="org.eclipse.jetty.server.NCSARequestLog"> <Set name="filename"><SystemProperty name="jetty.home" default="."/>/logs/yyyy_mm_dd.request.log</Set> <Set name="filenameDateFormat">yyyy_MM_dd</Set> <Set name="retainDays">90</Set> <Set name="append">true</Set> <Set name="extended">true</Set> <Set name="logCookies">false</Set> <Set name="LogTimeZone">GMT</Set> <Set name="LogServer">true</Set> </New> </Set> </Ref> The format of the logfile entries are as follows based on the parameters: Extended LogServer Format False False "%host %other %logname %time1 %methodurl %code %bytesd" False True "%virtualname %host %other %logname %time1 %methodurl %code %bytesd" True False "%host %other %logname %time1 %methodurl %code %bytesd %refererquot %uaquot" True True "%virtualname %host %other %logname %time1 %methodurl %code %bytesd %refererquot %uaquot" With the following being the legend: # %virtualname Web sever virtual hostname. Use this tag when same log # contains data of several virtual web servers. AWStats # will discard records not in SiteDomain nor HostAliases # %host Client hostname or IP address (or Sender host for mail log) # %other Means another not used field # %logname Authenticated login/user with format: john # %time1 Date and time with format: [dd/mon/yyyy:hh:mm:ss +0000] or [dd/mon/yyyy:hh:mm:ss] # %methodurl Method and URL with format: "GET /index.html HTTP/x.x" # %code Return code status (with format for web log: 999) # %bytesd Size of document in bytes # %refererquot Referer page with format: "http://from.com/from.htm" # %uaquot User agent with format: "Mozilla/4.0 (compatible, ...)" You could write your own RequestLogger and have the server name mapped into the log file name. I am planning on adding the JavaDoc to the NCSARequestLogger (https://bugs.eclipse.org/bugs/show_bug.cgi?id=302350) so that the impact of changing the parameter values is clear. Loren On Feb 10, 2010, at 02:23 AM, Thomas White wrote: > > Loren, > > This is a very useful extension. I like it very much. > I would like to suggest two additional features: > specify the name of the log file explicitly. > to allow wildcat symbols in the server name: > <root server-name="images*,.example.com" pattern="/*" path="xmldb:exist:///db/images/" log-name="images-xxx,example.com"/> > > This is particularly useful when we want images in a web page to load quicker, to bypass the browser limit of downloading only up to 2 files simultaneously from a domain. > > Thomas |