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(String filename) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doStart() |
protected void |
doStop() |
String |
getDatedFilename() |
String |
getFilename() |
String |
getFilenameDateFormat() |
String[] |
getIgnorePaths() |
boolean |
getLogCookies() |
String |
getLogDateFormat() |
boolean |
getLogLatency() |
Locale |
getLogLocale() |
boolean |
getLogServer() |
String |
getLogTimeZone() |
int |
getRetainDays() |
boolean |
isAppend() |
boolean |
isExtended() |
void |
log(Request request,
Response response) |
protected void |
logExtended(Request request,
Response response,
Writer writer) |
void |
setAppend(boolean append) |
void |
setExtended(boolean extended) |
void |
setFilename(String filename) |
void |
setFilenameDateFormat(String logFileDateFormat)
Set the log file date format.
|
void |
setIgnorePaths(String[] ignorePaths) |
void |
setLogCookies(boolean logCookies) |
void |
setLogDateFormat(String format) |
void |
setLogLatency(boolean logLatency) |
void |
setLogLocale(Locale logLocale) |
void |
setLogServer(boolean logServer) |
void |
setLogTimeZone(String tz) |
void |
setPreferProxiedForAddress(boolean preferProxiedForAddress) |
void |
setRetainDays(int retainDays) |
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stoppublic NCSARequestLog()
public NCSARequestLog(String filename)
filename - The filename for the request log. This may be in the format expected by RolloverFileOutputStreampublic void setFilename(String filename)
filename - The filename for the request log. This may be in the format expected by RolloverFileOutputStreampublic String getFilename()
public String getDatedFilename()
public void setLogDateFormat(String format)
format - Format for the timestamps in the log file. If not set,
the pre-formated request timestamp is used.public String getLogDateFormat()
public void setLogLocale(Locale logLocale)
public Locale getLogLocale()
public void setLogTimeZone(String tz)
public 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(String[] ignorePaths)
public 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 RequestLogprotected void logExtended(Request request, Response response, Writer writer) throws IOException
IOExceptionprotected void doStart()
throws Exception
doStart in class org.mortbay.component.AbstractLifeCycleExceptionprotected void doStop()
throws Exception
doStop in class org.mortbay.component.AbstractLifeCycleExceptionpublic String getFilenameDateFormat()
public void setFilenameDateFormat(String logFileDateFormat)
logFileDateFormat - the logFileDateFormat to pass to RolloverFileOutputStreamRolloverFileOutputStream#RolloverFileOutputStream(String, boolean, int, TimeZone, String, String)}Copyright © 2009 Mortbay Consulting Pty. Ltd. All Rights Reserved.