The STATS Component may be configured to generate statistics using popular webstats software such as AWSTATS. There are two methods for tracking and generating webstats:

  1. Using the logs generated via standard Portlet Stats service (portlet level stats)
  2. Using the logs generated via Tomcat's Access Log Valve (page level stats)

The following are instructions to configure STATS Component to use one of the above methods.

Required by both methods

1. Enable the Portal Stats Service in ngsportal-stats.properties:

services.PortalStats.classname = com.ngsltd.portal.services.portalstats.AwstatsPortalStatsService

services.PortalStats.includes = portal/group/,portal/user/anon

services.PortalStats.perl.exe = perl

services.PortalStats.perl.script = awstats_buildstaticpages.pl

services.PortalStats.perl.script.folder = /WEB-INF/awstats

services.PortalStats.output.folder = /awstats

services.PortalStats.awstats.config = ngsportal

2. Enable the scheduled job to generate the webstats static pages:

scheduler.jobs = stats.PortalStatsUpdateJob

scheduler.job.stats.PortalStatsUpdateJob.ID = 999

scheduler.job.stats.PortalStatsUpdateJob.SECOND = 0

scheduler.job.stats.PortalStatsUpdateJob.MINUTE = 60

Portlet Stats Service method

1. Enable the Portlet Stats Service in JetspeedResources.properties.

services.PortletStats.classname = com.ngsltd.portal.services.portletstats.CustomPortletStatsService

services.PortletStats.enabled = true

services.PortletStats.dateFormat = dd/MMM/yyyy:hh:mm:ss z

services.PortletStats.logLoadTime = true

2. Configure the access log in log4j:

log4j.category.org.apache.jetspeed.services.portletstats.JetspeedPortletStatsService = DEBUG, access

log4j.additivity.org.apache.jetspeed.services.portletstats.JetspeedPortletStatsService = false

log4j.appender.access = org.apache.log4j.RollingFileAppender

log4j.appender.access.file = ${webappRoot}/WEB-INF/log/access.log

log4j.appender.access.MaxFileSize = 1024KB

log4j.appender.access.MaxBackupIndex = 5

log4j.appender.access.layout = org.apache.log4j.PatternLayout

log4j.appender.access.layout.conversionPattern = %m%n

log4j.appender.access.layout.ConversionPattern = [%d{dd MMM yyyy HH:mm:ss} %5p] - %m%n

log4j.appender.access.append = true

3. Configure the log file name in awstats configuration file as in the example below:

LogFile="/jakarta-tomcat-4.1.24/webapps/ngsportal/WEB-INF/log/access.log"

The above example matches the log file generated by the log4j settings. See Tomcat's and Log4J's documentation for other information.

Access Log Valve method

1. Add the following valve definition in the webapp context section:

<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="ngsportal_access." suffix=".log" pattern="combined" resolveHosts="false"/>

For example:

<Context path="/ngsportal" docBase="ngsportal" crossContext="true" reloadable="true" privileged="true">

    <
Manager className="org.apache.catalina.session.PersistentManager" debug="0" saveOnRestart="false">

        <
Store className="org.apache.catalina.session.FileStore"/>

    </
Manager>

    <
Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="ngsportal_access." suffix=".log" pattern="combined" resolveHosts="false"/>

</
Context>

2. Configure the log file name in awstats configuration file as in the example below:

LogFile="/jakarta-tomcat-4.1.24/logs/ngsportal_access.%YYYY-0-%MM-0-%DD-0.log"

The above example matches the log file generated by the valve definition. See Tomcat's and AWSTAT's documentation for other information.