public class AccessLog extends AbstractAccessLog implements AlarmListener
Modifier and Type | Field and Description |
---|---|
static int |
BUFFER_SIZE |
protected static L10N |
L |
protected static java.util.logging.Logger |
log |
_path, _pathFormat
Constructor and Description |
---|
AccessLog() |
Modifier and Type | Method and Description |
---|---|
void |
addExclude(java.util.regex.Pattern pattern)
Adds an exclusion pattern.
|
void |
destroy()
Closes the log, flushing the results.
|
void |
flush()
Flushes the log.
|
int |
getBufferSize() |
void |
handleAlarm(Alarm alarm)
The alarm listener.
|
void |
init()
Initialize the log.
|
void |
log(HttpServletRequest req,
HttpServletResponse res,
ServletContext application)
Logs a request using the current format.
|
void |
setArchiveFormat(java.lang.String format)
Sets the archive name format
|
void |
setAutoFlush(boolean isAutoFlush)
Sets the auto-flush attribute.
|
void |
setAutoFlushTime(Period period)
Sets the autoFlushTime
|
void |
setBufferSize(Bytes bytes)
Sets the log buffer size.
|
void |
setFormat(java.lang.String format)
Sets the access log format.
|
void |
setPath(Path path)
Sets the log path
|
void |
setPathFormat(java.lang.String pathFormat)
Sets the formatted path.
|
void |
setRolloverCheckTime(Period period)
Sets how often the log rollover will be checked.
|
void |
setRolloverCount(int count)
Sets the maximum number of rolled logs.
|
void |
setRolloverCron(CronType cron)
Sets the log rollover cron
|
void |
setRolloverPeriod(Period period)
Sets the log rollover period, rounded up to the nearest hour.
|
void |
setRolloverSize(Bytes bytes)
Sets the log rollover size, rounded up to the megabyte.
|
void |
setSharedBuffer(boolean isSharedBuffer)
Sets the shared buffer attribute.
|
addInit, getPath, getPathFormat, isHostnameDnsLookup, setHostnameDnsLookup, setId
protected static final L10N L
protected static final java.util.logging.Logger log
public static final int BUFFER_SIZE
@Configurable public void setBufferSize(Bytes bytes)
bytes
- bufferpublic int getBufferSize()
getBufferSize
in class AbstractAccessLog
public void setFormat(java.lang.String format)
public void setPath(Path path)
setPath
in class AbstractAccessLog
@Configurable public void setPathFormat(java.lang.String pathFormat) throws ConfigException
setPathFormat
in class AbstractAccessLog
ConfigException
@Configurable public void setArchiveFormat(java.lang.String format)
@Configurable public void setRolloverCount(int count)
count
- maximum count of the log file@Configurable public void setRolloverCron(CronType cron)
cron
- the cron string for rollover times@Configurable public void setRolloverPeriod(Period period)
period
- the new rollover period in milliseconds.@Configurable public void setRolloverSize(Bytes bytes)
bytes
- buffer@Configurable public void setRolloverCheckTime(Period period)
period
- how often the log rollover will be checked.@Configurable public void setAutoFlush(boolean isAutoFlush)
public void setAutoFlushTime(Period period)
public void setSharedBuffer(boolean isSharedBuffer)
@Configurable public void addExclude(java.util.regex.Pattern pattern)
@PostConstruct public void init() throws ServletException, java.io.IOException
init
in class AbstractAccessLog
ServletException
java.io.IOException
public void log(HttpServletRequest req, HttpServletResponse res, ServletContext application) throws java.io.IOException
log
in class AbstractAccessLog
req
- the servlet request.res
- the servlet response.java.io.IOException
public void flush()
flush
in class AbstractAccessLog
public void handleAlarm(Alarm alarm)
handleAlarm
in interface AlarmListener
public void destroy() throws java.io.IOException
destroy
in class AbstractAccessLog
java.io.IOException