|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.protocol.http.AbstractRequestLogger
public abstract class AbstractRequestLogger
Base class that collects request and session information for request logging to enable rich information about the events that transpired during a single request. Typical HTTPD and/or Servlet container log files are unusable for determining what happened in the application since they contain the requested URLs of the form http://example.com/app?wicket:interface:0:0:0, which doesn't convey any useful information. Requestloggers can show which page was the target of the request, and which page was rendered as a response, and anything else: resources, Ajax request, etc.
The information in the log files can take any format, depending on the request logger
implementation: currently Wicket supports two formats: a legacy, log4j
compatible format
, and a JSON format
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.wicket.protocol.http.IRequestLogger |
---|
IRequestLogger.ISessionLogInfo, IRequestLogger.RequestData, IRequestLogger.SessionData |
Constructor Summary | |
---|---|
AbstractRequestLogger()
Construct. |
Method Summary | |
---|---|
protected void |
addRequest(IRequestLogger.RequestData rd)
|
protected String |
formatDate(Date date)
Thread-safely formats the passed date in format 'yyyy-MM-dd hh:mm:ss,SSS' with GMT timezone |
long |
getAverageRequestTime()
|
int |
getCurrentActiveRequestCount()
|
protected IRequestLogger.RequestData |
getCurrentRequest()
|
IRequestLogger.SessionData[] |
getLiveSessions()
|
int |
getPeakActiveRequestCount()
|
int |
getPeakSessions()
|
List<IRequestLogger.RequestData> |
getRequests()
This method returns a List of the current requests that are in mem. |
long |
getRequestsPerMinute()
|
int |
getTotalCreatedSessions()
|
protected abstract void |
log(IRequestLogger.RequestData rd,
IRequestLogger.SessionData sd)
|
void |
logEventTarget(IRequestHandler requestHandler)
Sets the target that was the event target for the current request |
void |
logRequestedUrl(String url)
Logs the URL that was requested by the browser. |
void |
logResponseTarget(IRequestHandler requestHandler)
Sets the target that was the response target for the current request |
void |
objectCreated(Object value)
Called to monitor additions of objects in the ISessionStore |
void |
objectRemoved(Object value)
Called to monitor removals of objects out of the ISessionStore |
void |
objectUpdated(Object value)
Called to monitor updates of objects in the ISessionStore |
void |
performLogging()
Perform the actual logging |
void |
requestTime(long timeTaken)
This method is called when the request is over. |
void |
sessionCreated(String sessionId)
called when the session is created and has an id. |
void |
sessionDestroyed(String sessionId)
Method used to cleanup a livesession when the session was invalidated by the webcontainer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractRequestLogger()
Method Detail |
---|
public int getCurrentActiveRequestCount()
getCurrentActiveRequestCount
in interface IRequestLogger
public int getPeakActiveRequestCount()
getPeakActiveRequestCount
in interface IRequestLogger
public IRequestLogger.SessionData[] getLiveSessions()
getLiveSessions
in interface IRequestLogger
public int getPeakSessions()
getPeakSessions
in interface IRequestLogger
public List<IRequestLogger.RequestData> getRequests()
IRequestLogger
getRequests
in interface IRequestLogger
public int getTotalCreatedSessions()
getTotalCreatedSessions
in interface IRequestLogger
public void objectCreated(Object value)
IRequestLogger
ISessionStore
objectCreated
in interface IRequestLogger
value
- the object being created/addedpublic void objectRemoved(Object value)
IRequestLogger
ISessionStore
objectRemoved
in interface IRequestLogger
value
- the object being removedpublic void objectUpdated(Object value)
IRequestLogger
ISessionStore
objectUpdated
in interface IRequestLogger
value
- the object being updatedpublic void requestTime(long timeTaken)
IRequestLogger
requestTime
in interface IRequestLogger
timeTaken
- the time taken in millisecondspublic void sessionCreated(String sessionId)
IRequestLogger
sessionCreated
in interface IRequestLogger
sessionId
- the session idpublic void sessionDestroyed(String sessionId)
IRequestLogger
sessionDestroyed
in interface IRequestLogger
sessionId
- the session idprotected IRequestLogger.RequestData getCurrentRequest()
public void performLogging()
IRequestLogger
performLogging
in interface IRequestLogger
protected abstract void log(IRequestLogger.RequestData rd, IRequestLogger.SessionData sd)
protected void addRequest(IRequestLogger.RequestData rd)
public long getAverageRequestTime()
getAverageRequestTime
in interface IRequestLogger
public long getRequestsPerMinute()
getRequestsPerMinute
in interface IRequestLogger
public void logEventTarget(IRequestHandler requestHandler)
IRequestLogger
logEventTarget
in interface IRequestLogger
requestHandler
- the event targetpublic void logRequestedUrl(String url)
IRequestLogger
logRequestedUrl
in interface IRequestLogger
url
- the requested URLpublic void logResponseTarget(IRequestHandler requestHandler)
IRequestLogger
logResponseTarget
in interface IRequestLogger
requestHandler
- the response targetprotected String formatDate(Date date)
date
- the date to format
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |