org.eclipse.jetty.server.RequestLog
, org.eclipse.jetty.util.component.LifeCycle
public class I2PRequestLog
extends org.eclipse.jetty.util.component.AbstractLifeCycle
implements org.eclipse.jetty.server.RequestLog
RequestLog
implementation 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.コンストラクタ | 説明 |
---|---|
I2PRequestLog() |
|
I2PRequestLog(java.lang.String filename) |
修飾子とタイプ | メソッド | 説明 |
---|---|---|
protected void |
doStart() |
|
protected void |
doStop() |
|
java.lang.String |
getDatedFilename() |
|
java.lang.String |
getFilename() |
|
java.lang.String |
getFilenameDateFormat() |
|
java.lang.String[] |
getIgnorePaths() |
|
boolean |
getLogCookies() |
|
java.lang.String |
getLogDateFormat() |
|
boolean |
getLogLatency() |
|
java.util.Locale |
getLogLocale() |
|
boolean |
getLogServer() |
|
java.lang.String |
getLogTimeZone() |
|
int |
getRetainDays() |
|
boolean |
isAppend() |
|
boolean |
isExtended() |
|
void |
log(org.eclipse.jetty.server.Request request,
org.eclipse.jetty.server.Response response) |
|
protected void |
logExtended(org.eclipse.jetty.server.Request request,
org.eclipse.jetty.server.Response response,
java.io.Writer writer) |
|
void |
setAppend(boolean append) |
|
void |
setB64(boolean b64) |
|
void |
setExtended(boolean extended) |
|
void |
setFilename(java.lang.String filename) |
|
void |
setFilenameDateFormat(java.lang.String logFileDateFormat) |
Set the log file date format.
|
void |
setIgnorePaths(java.lang.String[] ignorePaths) |
|
void |
setLogCookies(boolean logCookies) |
|
void |
setLogDateFormat(java.lang.String format) |
|
void |
setLogLatency(boolean logLatency) |
|
void |
setLogLocale(java.util.Locale logLocale) |
|
void |
setLogServer(boolean logServer) |
|
void |
setLogTimeZone(java.lang.String tz) |
|
void |
setPreferProxiedForAddress(boolean preferProxiedForAddress) |
|
void |
setRetainDays(int retainDays) |
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop
public I2PRequestLog()
public I2PRequestLog(java.lang.String filename)
filename
- The filename for the request log. This may be in the format expected by RolloverFileOutputStream
public void setFilename(java.lang.String filename)
filename
- The filename for the request log. This may be in the format expected by RolloverFileOutputStream
public java.lang.String getFilename()
public java.lang.String getDatedFilename()
public void setLogDateFormat(java.lang.String format)
format
- Format for the timestamps in the log file. If not set,
the pre-formated request timestamp is used.public java.lang.String getLogDateFormat()
public void setLogLocale(java.util.Locale logLocale)
public java.util.Locale getLogLocale()
public void setLogTimeZone(java.lang.String tz)
public java.lang.String getLogTimeZone()
public void setRetainDays(int retainDays)
public int getRetainDays()
public void setExtended(boolean extended)
public boolean isExtended()
public void setAppend(boolean append)
public boolean isAppend()
public void setIgnorePaths(java.lang.String[] ignorePaths)
public java.lang.String[] getIgnorePaths()
public void setLogCookies(boolean logCookies)
public boolean getLogCookies()
public boolean getLogServer()
public void setLogServer(boolean logServer)
public void setLogLatency(boolean logLatency)
public boolean getLogLatency()
public void setPreferProxiedForAddress(boolean preferProxiedForAddress)
public void setB64(boolean b64)
b64
- true to enable base 64 logging. False for base 32 logging. Default false.public void log(org.eclipse.jetty.server.Request request, org.eclipse.jetty.server.Response response)
log
インタフェース内 org.eclipse.jetty.server.RequestLog
protected void logExtended(org.eclipse.jetty.server.Request request, org.eclipse.jetty.server.Response response, java.io.Writer writer) throws java.io.IOException
java.io.IOException
protected void doStart() throws java.lang.Exception
doStart
クラス内 org.eclipse.jetty.util.component.AbstractLifeCycle
java.lang.Exception
protected void doStop() throws java.lang.Exception
doStop
クラス内 org.eclipse.jetty.util.component.AbstractLifeCycle
java.lang.Exception
public java.lang.String getFilenameDateFormat()
public void setFilenameDateFormat(java.lang.String logFileDateFormat)
logFileDateFormat
- the logFileDateFormat to pass to RolloverFileOutputStream