|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.abstracthorizon.danube.support.logging.AccessLogConnectionHandler
public class AccessLogConnectionHandler
This handler implements simple access log.
If internally defines following pattern codes (through CurrentDateTimeProcessor
,
HandlingTimeProcessor
and SocketDetailsProcessor
):
%A
- local IP address%a
- remote IP address%p
- local port number%h
- remote host name%T
- connection handling elapsed time in seconds%D
- connection handling elapsed time in milliseconds%t
- current time in Common Log FormatMain aim was to keep as much compatibility with already known codes from Apache HTTP server
Nested Class Summary | |
---|---|
static class |
AccessLogConnectionHandler.DateWrapper
Simple connection wrapper that adds handling started time in milliseconds |
Field Summary | |
---|---|
protected int |
argumentNumber
Number of arguments |
protected org.slf4j.Logger |
logger
Logger |
protected String |
logPatternString
Internal log pattern string |
protected PatternProcessor[] |
selectedProcessors
Defined providers |
Constructor Summary | |
---|---|
AccessLogConnectionHandler()
Constructor. |
Method Summary | |
---|---|
protected void |
addPredefinedProcessors(List<String> providerClasses)
Adds lists of predefined processors to the lists of provider classes. |
protected String |
createLogLine(Connection connection,
long start)
Creates log line. |
ConnectionHandler |
getConnectionHandler()
Returns connection handler |
List<String> |
getCustomProcessors()
Returns a list of custom processors' file names |
protected String |
getDefaultLogPattern()
Returns default log pattern |
LogFileRotator |
getLogFileRotator()
Returns log file rotator implementation |
String |
getLogPattern()
Returns log pattern |
void |
handleConnection(Connection connection)
Invokes supplied connectionHandler measuring time and then
writes the log line |
protected void |
outputLogLine(String logLine)
This method output log line to the log. |
void |
setConnectionHandler(ConnectionHandler connectionHandler)
Sets connection handler |
void |
setCustomProcessors(List<String> customProcessors)
Sets a list of custom processors' file names |
void |
setLogFileRotator(LogFileRotator logFileRotator)
Sets log file rotator implementation |
void |
setLogPattern(String logPattern)
Sets log pattern |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final org.slf4j.Logger logger
protected String logPatternString
protected PatternProcessor[] selectedProcessors
protected int argumentNumber
Constructor Detail |
---|
public AccessLogConnectionHandler()
Method Detail |
---|
protected String getDefaultLogPattern()
public ConnectionHandler getConnectionHandler()
public void setConnectionHandler(ConnectionHandler connectionHandler)
connectionHandler
- conneciton handlerpublic List<String> getCustomProcessors()
public void setCustomProcessors(List<String> customProcessors)
customProcessors
- a list of custom processors' file namespublic LogFileRotator getLogFileRotator()
public void setLogFileRotator(LogFileRotator logFileRotator)
logFileRotator
- log file rotator implementationpublic String getLogPattern()
public void setLogPattern(String logPattern)
logPattern
- log patternprotected void addPredefinedProcessors(List<String> providerClasses)
Adds lists of predefined processors to the lists of provider classes.
This method adds following:
providerClasses
- list of provider classespublic void handleConnection(Connection connection)
connectionHandler
measuring time and then
writes the log line
handleConnection
in interface ConnectionHandler
connection
- connectionprotected void outputLogLine(String logLine)
logLine
- log lineprotected String createLogLine(Connection connection, long start)
null
.
connection
- connectionstart
- start time
null
for nothing to be logged
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |