+

Search Tips   |   Advanced Search


Log and analyzing server side site data

WebSphere Portal implements a logging function for your usage data. The portal writes usage records to a dedicated log file if site analysis logging is enabled. Multiple types of site analyzer loggers allow portal administrators to collect statistical data in various areas. The portal server manages the collection of data on its own, but from a business point of view you can also log custom details of business events.

The portal configuration service SiteAnalyzerLogService determines the type of site analysis data that the portal logs at run time. Depending on the service configuration, the portal logs the following events:

The resulting log entries comply with the industry standard NCSA Combined. By analyzing them you can measure the success of applications made available by the portal installation. The site analysis infrastructure provided by the portal accommodates most scenarios.

To obtain a more sophisticated evaluation of the portal usage, or to generate reports for portlet actions, write a custom report to log custom business events that occur in portlets.

Enable site analysis logging

Site analysis logging is not enabled by default.

To configure WebSphere Portal for site analysis logging, set the following parameters in the WP SiteAnalyzerLogService as described in Set service configuration properties.

  1. Set the parameters for the file names of the log files and backup log files. To specify the file name format, follow these instructions and use the tokens listed after the instructions:

    1. Search for the parameter SiteAnalyzerFileHandler.fileName.

      Use this parameter to determine the location and filename of the log file. Default is logs/$APPSERVER_NAME/sa.log .

    2. Search for the parameter SiteAnalyzerFileHandler.backupFileName.

      Use this parameter to determine the location and filename of the backup file for the log file. Default is logs/$APPSERVER_NAME/sa_$CREATE_TIME.log.

    When the log file is backed up, the current data is stored in a file named by the parameter SiteAnalyzerFileHandler.backupFileName you specified (default logs/$APPSERVER_NAME/sa_$CREATE_TIME.log ) and a new file is created for the new data with the name you specified by the SiteAnalyzerFileHandler.fileName parameter (default sa.log ).

    When defining the names for the log files and backup files, you can specify the three following tokens as part of the directory location or file name:

    $APPSERVER_NAME

    The name of the appserver. Use this token for vertical clusters to enforce that the different appservers write into different files if they share the same file system.

    $CREATE_TIME

    The date and time at which the file was created. The date format of this token is specified by the SiteAnalyzerFileHandler.dateFormat parameter as described below.

    $CLOSE_TIME

    The date and time at which the file was closed. The date format of this token is specified by SiteAnalyzerFileHandler.dateFormat parameter as described below. For a file that WebSphere Portal is currently writing to, the value for $CLOSE_TIME is the same as $CREATE_TIME.

    An example with all three tokens: You can specify the file location and name for a log file or backup file as follows: log/backup/$APPSERVER_NAME/sa_$CREATE_TIME_$CLOSE_TIME.log.

    The format for the $CREATE_TIME and $CLOSE_TIME tokens is defined by the value set for the SiteAnalyzerFileHandler.dateFormat parameter as described in the next step below.

  2. Set the parameter for the date format tokens in the log file names. To do this, search for the parameter SiteAnalyzerFileHandler.dateFormat. Use this parameter to set the date and time formats in the $CREATE_TIME and $CLOSE_TIME tokens that are part of the log file names. The value you specify determines the format of the date and time that replace the token in the names of the base and backup log files. Example of date and time format: SiteAnalyzerFileHandler.dateFormat=yyyy.MM.dd-HH.mm.ss.

  3. To control the interval at which the log file is backed up, uncomment only one of the following parameters and set the time interval for it:

    • To log in intervals of minutes, uncomment SiteAnalyzerFileHandler.minutesPerLogFile and set the value to an integer in the range 1 to 60.

    • To log in intervals of hours, uncomment SiteAnalyzerFileHandler.hoursPerLogFile and set the value to an integer in the range 1 to 24.

    • To log in intervals of days, uncomment SiteAnalyzerFileHandler.daysPerLogFile and set the value to an integer that indicates the number of days.

    Notes:

    1. If you enable more than one date format interval, the smallest interval will be used.

    2. The difference between 60 minutes and 1 hour is as follows:

      If you specify 60 minutes the file is backed up after 60 minutes, but if you specify 1 hour, the file is backed up on the next full hour interval, such as 01:00, 02:00 and so on. For day intervals, the file is backed up only at 24:00 (midnight). If you need more information about the date format, see the Javadoc for java.text.SimpleDateFormat.

    The flexibility of the date format makes it easy to coordinate scheduling the file backup.

    For example, you can configure WebSphere Portal to backup the site analysis log every hour.

  4. Activate selected loggers:

    • To activate logging for certain loggers, uncomment the loggers that you want to use and set them to true. See the following table for a description of each logger.

    WebSphere Portal Server Analysis Logger Description and Activity Logged
    SiteAnalyzerSessionLogger.isLogging HTTP requests that include the URLs:

    /Command/Login

    /Command/Logout

    SiteAnalyzerUserManagementLogger.isLogging HTTP requests that include the URLs:

    /Command/UserManagement/CreateUser

    /Command/UserManagement/DeleteUser

    /Command/UserManagement/CreateGroup

    /Command/UserManagement/DeleteGroup

    SiteAnalyzerPageLogger.isLogging HTTP requests that include the URLs:

    /Page/*

    /Command/Customizer/CreatePage

    /Command/Customizer/EditPage

    /Command/Customizer/DeletePage

    SiteAnalyzerPortletLogger.isLogging HTTP requests that include the URLs:

    /Portlet/*

    SiteAnalyzerPortletActionLogger.isLogging HTTP requests that include the URLs:

    /PortletAction/*

    SiteAnalyzerErrorLogger.isLogging HTTP requests that include the URLs:

    /Error/Portlet

    /Error/Page

    The referrer field points to a portlet name or a page name. Examples of such referrer fields are:

    http://your.server.name/Portlet/1/PortletName

    http://your.server.name/Page/1/PageName

    SiteAnalyzerApplicationActionLogger.isLogging=true HTTP requests that include the URLs:

    /ApplicationAction/*

  5. Restart the WebSphere Portal appserver to commit the changes.

Disable site analysis logging

Site analysis logging can have performance impacts so you might want to disable it when not in use. By default site analysis logging is not enabled. To disable site analysis logging, search for the desired parameter(s) as listed in the table above and set them to false.


Parent topic:

Analyzing portal usage data