Package net.i2p.jetty
Class I2PRequestLog
- java.lang.Object
- 
- org.eclipse.jetty.util.component.AbstractLifeCycle
- 
- net.i2p.jetty.I2PRequestLog
 
 
- 
- All Implemented Interfaces:
- RequestLog,- LifeCycle
 
 public class I2PRequestLog extends AbstractLifeCycle implements RequestLog ThisRequestLogimplementation outputs logs in the pseudo-standard NCSA common log format. Configuration options allow a choice between the standard Common Log Format (as used in the 3 log format) and the Combined Log Format (single log format). This log format can be output by most web servers, and almost all web log analysis software can understand these formats. ** I2P Mods ** For Jetty 5, this extended NCSARequestLog to override log() to put in the requestor's destination hash, instead of 127.0.0.1, which is placed in the X-I2P-DestHash field in the request headers by I2PTunnelHTTPServer. But we also had to modify NCSARequestLog to do so, to change private fields to protected. So that we will work with system Jetty 6 packages, we just copy the whole thing and modify log() as required.- Author:
- Greg Wilkins, Nigel Canonizado
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycleAbstractLifeCycle.AbstractLifeCycleListener
 - 
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycleLifeCycle.Listener
 
- 
 - 
Field Summary- 
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycleFAILED, RUNNING, STARTED, STARTING, STOP_ON_FAILURE, STOPPED, STOPPING
 
- 
 - 
Constructor SummaryConstructors Constructor Description I2PRequestLog()I2PRequestLog(String filename)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoStart()protected voiddoStop()StringgetDatedFilename()StringgetFilename()StringgetFilenameDateFormat()String[]getIgnorePaths()booleangetLogCookies()StringgetLogDateFormat()booleangetLogLatency()LocalegetLogLocale()booleangetLogServer()StringgetLogTimeZone()intgetRetainDays()booleanisAppend()booleanisExtended()voidlog(Request request, Response response)protected voidlogExtended(Request request, Response response, Writer writer)voidsetAppend(boolean append)voidsetB64(boolean b64)voidsetExtended(boolean extended)voidsetFilename(String filename)voidsetFilenameDateFormat(String logFileDateFormat)Set the log file date format.voidsetIgnorePaths(String[] ignorePaths)voidsetLogCookies(boolean logCookies)voidsetLogDateFormat(String format)voidsetLogLatency(boolean logLatency)voidsetLogLocale(Locale logLocale)voidsetLogServer(boolean logServer)voidsetLogTimeZone(String tz)voidsetPreferProxiedForAddress(boolean preferProxiedForAddress)voidsetRetainDays(int retainDays)- 
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycleaddLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop
 
- 
 
- 
- 
- 
Constructor Detail- 
I2PRequestLogpublic I2PRequestLog() 
 - 
I2PRequestLogpublic I2PRequestLog(String filename) - Parameters:
- filename- The filename for the request log. This may be in the format expected by- RolloverFileOutputStream
 
 
- 
 - 
Method Detail- 
setFilenamepublic void setFilename(String filename) - Parameters:
- filename- The filename for the request log. This may be in the format expected by- RolloverFileOutputStream
 
 - 
getFilenamepublic String getFilename() 
 - 
getDatedFilenamepublic String getDatedFilename() 
 - 
setLogDateFormatpublic void setLogDateFormat(String format) - Parameters:
- format- Format for the timestamps in the log file. If not set, the pre-formated request timestamp is used.
 
 - 
getLogDateFormatpublic String getLogDateFormat() 
 - 
setLogLocalepublic void setLogLocale(Locale logLocale) 
 - 
getLogLocalepublic Locale getLogLocale() 
 - 
setLogTimeZonepublic void setLogTimeZone(String tz) 
 - 
getLogTimeZonepublic String getLogTimeZone() 
 - 
setRetainDayspublic void setRetainDays(int retainDays) 
 - 
getRetainDayspublic int getRetainDays() 
 - 
setExtendedpublic void setExtended(boolean extended) 
 - 
isExtendedpublic boolean isExtended() 
 - 
setAppendpublic void setAppend(boolean append) 
 - 
isAppendpublic boolean isAppend() 
 - 
setIgnorePathspublic void setIgnorePaths(String[] ignorePaths) 
 - 
getIgnorePathspublic String[] getIgnorePaths() 
 - 
setLogCookiespublic void setLogCookies(boolean logCookies) 
 - 
getLogCookiespublic boolean getLogCookies() 
 - 
getLogServerpublic boolean getLogServer() 
 - 
setLogServerpublic void setLogServer(boolean logServer) 
 - 
setLogLatencypublic void setLogLatency(boolean logLatency) 
 - 
getLogLatencypublic boolean getLogLatency() 
 - 
setPreferProxiedForAddresspublic void setPreferProxiedForAddress(boolean preferProxiedForAddress) 
 - 
setB64public void setB64(boolean b64) - Parameters:
- b64- true to enable base 64 logging. False for base 32 logging. Default false.
- Since:
- 0.9.24
 
 - 
logpublic void log(Request request, Response response) - Specified by:
- login interface- RequestLog
 
 - 
logExtendedprotected void logExtended(Request request, Response response, Writer writer) throws IOException - Throws:
- IOException
 
 - 
doStartprotected void doStart() throws Exception- Overrides:
- doStartin class- AbstractLifeCycle
- Throws:
- Exception
 
 - 
doStopprotected void doStop() throws Exception- Overrides:
- doStopin class- AbstractLifeCycle
- Throws:
- Exception
 
 - 
getFilenameDateFormatpublic String getFilenameDateFormat() - Returns:
- the log File Date Format
 
 - 
setFilenameDateFormatpublic void setFilenameDateFormat(String logFileDateFormat) Set the log file date format. see RolloverFileOutputStream(String, boolean, int, TimeZone, String, String)- Parameters:
- logFileDateFormat- the logFileDateFormat to pass to RolloverFileOutputStream
 
 
- 
 
-