public abstract class AbstractRequestLogger extends Object implements IRequestLogger
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
.
IRequestLogger.ISessionLogInfo, IRequestLogger.RequestData, IRequestLogger.SessionData
Constructor and Description |
---|
AbstractRequestLogger()
Construct.
|
Modifier and Type | Method and Description |
---|---|
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() |
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
|
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 idpublic IRequestLogger.RequestData getCurrentRequest()
getCurrentRequest
in interface IRequestLogger
IRequestLogger.RequestData
for the current request.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 targetCopyright © 2006–2019 Apache Software Foundation. All rights reserved.