public class NCSARequestLog extends org.mortbay.component.AbstractLifeCycle implements 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.Constructor and Description |
---|
NCSARequestLog() |
NCSARequestLog(java.lang.String filename) |
Modifier and Type | Method and Description |
---|---|
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(Request request,
Response response) |
protected void |
logExtended(Request request,
Response response,
java.io.Writer writer) |
void |
setAppend(boolean append) |
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, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
public NCSARequestLog()
public NCSARequestLog(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 log(Request request, Response response)
log
in interface RequestLog
protected void logExtended(Request request, Response response, java.io.Writer writer) throws java.io.IOException
java.io.IOException
protected void doStart() throws java.lang.Exception
doStart
in class org.mortbay.component.AbstractLifeCycle
java.lang.Exception
protected void doStop() throws java.lang.Exception
doStop
in class org.mortbay.component.AbstractLifeCycle
java.lang.Exception
public java.lang.String getFilenameDateFormat()
public void setFilenameDateFormat(java.lang.String logFileDateFormat)
logFileDateFormat
- the logFileDateFormat to pass to RolloverFileOutputStream
RolloverFileOutputStream#RolloverFileOutputStream(String, boolean, int, TimeZone, String, String)}
Copyright © 2009 Mortbay Consulting Pty. Ltd. All Rights Reserved.