Configure WebSphere Portal for site analysis logging


WebSphere Portal implements a logging function for your portal usage data. To analyze the data, import the portal log file into Tivoli Web Site Analyzer and create reports about specific portal usage elements.

If you want to generate reports for portlet actions, write a custom report. See Tivoli Web Site Analyzer documentation for details on creating custom reports.

 

Enable site analysis logging

Site analysis logging is not enabled by default.

To configure WebSphere Portal for site analysis logging, proceed as follows:

  1. Edit wp_root/shared/app/config/services/SiteAnalyzerLogService.properties .
  2. Set the parameters for the file names of the log files and backup log files. To specify the file name format, proceed by the following instruction steps and use the tokens given below the instructions:

    1. Search for the parameter SiteAnalyzerFileHandler.fileName .

      Use this parameter to determine the location and filename of the log file. The default value is log/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. The default value is log/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 log/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 application servers 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 the 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.

  3. 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 .

  4. 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:

    • If you want to log in intervals of minutes, uncomment SiteAnalyzerFileHandler.minutesPerLogFile and set the value to an integer in the range 1 to 60.
    • If you want to log in intervals of hours, uncomment SiteAnalyzerFileHandler.hoursPerLogFile and set the value to an integer in the range 1 to 24.
    • If you want 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 and scheduling the file import into Tivoli Web Site Analyzer. For example, you can configure the portal to backup the site analysis log every hour and schedule Tivoli Web Site Analyzer to import the backed up files (sa_*.log) five minutes later.

  5. 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.

    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

  6. 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 perform the following steps:

  1. Edit <wps_root>/shared/app/config/services/SiteAnalyzerLogService.properties
  2. To disable site analysis logging, search for the desired parameter(s) as listed in the table above and comment them out, or set them to false.
  3. Restart the WebSphere Portal appserver to commit the changes.

 

Next steps

You have completed this step. Continue to the next step by choosing one of the following topics:

 

See also

Home |

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.

 

Tivoli is a trademark of the IBM Corporation in the United States, other countries, or both.