|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.turbine.services.BaseInitable org.apache.turbine.services.BaseService org.apache.turbine.services.TurbineBaseService org.apache.jetspeed.services.portletstats.JetspeedPortletStatsService
Simple implementation of the PortletStatsService. This implementation uses Apache Common Log Format (CLF) as its default log format. This format uses the following pattern string: "%h %l %u %t \"%r\" %>s %b", where:
Here's an example log entry:
127.0.0.1 - turbine [26/Aug/2002:11:44:40 -0500] "GET /jetspeed/DatabaseBrowserTest HTTP/1.1" 200 -
TODO:
Field Summary | |
protected java.lang.String |
dateFormat
Date format to use in the log entry. |
protected static java.lang.String |
defaultLogFormat
The default log format pattern string to use with the following elements:
|
protected java.text.SimpleDateFormat |
formatter
Date formatter |
protected static JetspeedLogger |
logger
Static initialization of the logger for this class |
protected boolean |
logLoadTime
Log portlet load time instead of bytes sent (which is always zero) |
Fields inherited from class org.apache.turbine.services.BaseService |
configuration, name, properties, serviceBroker |
Fields inherited from class org.apache.turbine.services.BaseInitable |
initableBroker, isInitialized |
Fields inherited from interface org.apache.jetspeed.services.portletstats.PortletStatsService |
SERVICE_NAME |
Constructor Summary | |
JetspeedPortletStatsService()
|
Method Summary | |
protected java.lang.String |
getLogMessage(org.apache.turbine.util.RunData data,
Portlet portlet,
java.lang.String statusCode,
long time)
Formats log message |
void |
init(javax.servlet.ServletConfig conf)
This is the early initialization method called by the Turbine Service framework |
boolean |
isEnabled()
Returns sevice enabled state |
void |
logAccess(org.apache.turbine.util.RunData data,
Portlet portlet,
java.lang.String statusCode)
Formats log message using default load time |
void |
logAccess(org.apache.turbine.util.RunData data,
Portlet portlet,
java.lang.String statusCode,
long time)
Logs portlet access. |
boolean |
setEnabled(boolean state)
Sets service enabled state |
Methods inherited from class org.apache.turbine.services.TurbineBaseService |
init, init, init, shutdown |
Methods inherited from class org.apache.turbine.services.BaseService |
getConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBroker |
Methods inherited from class org.apache.turbine.services.BaseInitable |
getInit, getInitableBroker, setInit, setInitableBroker |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.turbine.services.Service |
getConfiguration, getName, getProperties, setName, setServiceBroker |
Methods inherited from interface org.apache.turbine.services.Initable |
getInit, init, init, setInitableBroker, shutdown |
Field Detail |
protected static final JetspeedLogger logger
protected static final java.lang.String defaultLogFormat
protected java.lang.String dateFormat
protected java.text.SimpleDateFormat formatter
protected boolean logLoadTime
Constructor Detail |
public JetspeedPortletStatsService()
Method Detail |
public void init(javax.servlet.ServletConfig conf) throws org.apache.turbine.services.InitializationException
Service
framework
org.apache.turbine.services.InitializationException
public boolean isEnabled()
PortletStatsService
isEnabled
in interface PortletStatsService
PortletStatsService.isEnabled()
public boolean setEnabled(boolean state)
PortletStatsService
setEnabled
in interface PortletStatsService
state
- new state
PortletStatsService.setEnabled(boolean)
public void logAccess(org.apache.turbine.util.RunData data, Portlet portlet, java.lang.String statusCode, long time)
PortletStatsService
logAccess
in interface PortletStatsService
data
- Current request info objectportlet
- Portlet being loggedstatusCode
- HTTP status code. For now, either 200 (successfull) or 401 (unauthorized)PortletStatsService.logAccess(org.apache.turbine.util.RunData, org.apache.jetspeed.portal.Portlet, java.lang.String)
protected java.lang.String getLogMessage(org.apache.turbine.util.RunData data, Portlet portlet, java.lang.String statusCode, long time) throws java.lang.Exception
data
- portlet
- statusCode
- time
-
java.lang.Exception
public void logAccess(org.apache.turbine.util.RunData data, Portlet portlet, java.lang.String statusCode)
logAccess
in interface PortletStatsService
data
- portlet
- statusCode
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |