Configure WebSphere Portal for site analysis logging

 

+
Search Tips   |   Advanced Search

 

Overview

IBM WebSphere Portal implements a logging function for the portal usage data.

To generate reports for portlet actions, write a custom report.

 

Enable site analysis logging

Site analysis logging is not enabled by default.

To configure WebSphere Portal for site analysis logging, set the following properties in the SiteAnalyzerLogService file.

  1. 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 and a new file is created for the new data with the name you specified by the SiteAnalyzerFileHandler.fileName parameter...

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

    $APPSERVER_NAME

    The name of the application server. 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

    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

    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: We 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 we 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, we can configure the 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.

    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 application server 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.

 

Related information

 

Parent Topic

Logging and tracing