Setting Up Logging
This section explains how to set up usage statistics logging. After you do this, you can view data in the Usage Statistics feature.
Customizing Logging
The system uses three different jobs for keeping the logging database up to date. If desired, you can modify the frequency with which these jobs operate. For details, see the description of each job in The Logging Jobs section.
Clearing Historic Site Stats
Suggestions for Clearing Historic Site Stats
The SST_spProcessCleanUp stored procedure, which runs on a nightly basis as part of the ICS_NET_STAT – Process Usage Stats Clean Up job, reads the value of the RemoveAfterNumberOfDays setting and clears out the individual log records and related aggregated data for all sessions that have been completed by the specified number of days.
This stored procedure has the potential to remove millions of records when the RemoveAfterNumberOfDays setting is initially set to a value other than 0. To minimize the impact on the transaction logs, the stored procedure processes the deletions in small batches. Unfortunately, this means the process takes longer to run.
Because of the amount of time and potential resources needed, we have the following suggestions for changing the value of the RemoveAfterNumberOfDays setting from 0 to a different value:
Make sure index optimization has been running against the database. If there is an index optimization maintenance job that runs weekly, you may want to run it before the SST_spProcessCleanUp stored procedure runs.
If the stats database is set to Full Recovery, make sure the transaction logs are backed up frequently and with compression to help manage growth. This is not necessary if the database is set to Simple Recovery.
Change the value of the RemoveAfterNumberOfDays setting on a Friday or at another time when the system will not be heavily used so that the stored procedure can run for a longer time without taking away too many resources or creating other blocks.
Instead of setting the RemoveAfterNumberOfDays value to the desired number of days from the start, change the setting incrementally over several days. For example, if you want to keep only 6 months of data and you have 4 years of data total, you may want to change the setting to 3 years (1095) initially, and then set it to 2 years (730) the next day.
Once the final value of the RemoveAfterNumberOfDays setting is in place and the data has been removed, do not shrink the database to the size of the amount of data being used at that point. Index rebuilds and future growth require free space in the data file. Constantly shrinking database physical files and allowing them to regrow creates physical fragmentation and negatively affects performance. It is better to let the database reuse space it has already claimed than to shrink the database and then increase its size later when it needs to grow. For extreme cases in which you may want to shrink the database as a one-time solution, do not give back all of the space made available by the SST_spProcessCleanUp stored procedure. Also, wait until you are at the final value of the RemoveAfterNumberOfDays setting to prevent additional physical fragmentation.
If you have never logged usage statistics and you want to start, use the procedure below.
On the database server, open SQL Server Management Studio and complete the following steps:
Enable the following three jobs:
ICS_NET_STAT - Process Usage Stats
ICS_NET_STAT - Process Usage Stat Aggregate
ICS_NET_STAT - Process Usage Stat Clean Up
Start the ICS_NET_STAT - Process Usage Stats job.
Note that this job should always be executing—once it starts, it should not stop.
Note
If you start the ICS_NET_STAT - Process Usage Stats job and it immediately stops, see Troubleshooting for a possible solution.
Configure JICS to send data to the logging database:
Log in to JICS as an administrator.
Click the user icon and select Site Manager from the drop-down menu.
The system displays the Site Manager screen, with the Site settings tab selected.
Click the Framework settings tab.
Select Site stats from the drop-down list at the top of the screen.
Click the Enable Logging of Site Stats button to display On.
Click Save.
Note
An alternate way of configuring JICS to send data is through the main JICS database—you can update the FWK_ConfigSettings table, setting LogSiteStats to true.
By default JICS does not log page views that occur when users attempt to access pages they do not have permission to view. In JICS version 9.2.2 and higher, you can turn on the logging of such page views via the Log permission denied as a page view setting in Site Manager.
To activate or deactivate the logging of “permission denied” page views:
Log in to JICS as an administrator.
Click the user icon and select Site Manager from the drop-down menu.
The Site Manager screen displays, with the Site settings tab selected.
Click the Framework settings tab.
Select Site stats from the drop-down list at the top of the screen.
Take one of the following actions:
To enable the logging of “permission denied” page views, click the Log permission denied as a page view button to display On.
To disable the logging of “permission denied” page views, click the Log permission denied as a page view button to display Off.
Click Save.
Note
You can also use SQL Server Management Studio to update this setting in the FWK_ConfigSettings table. To activate the logging of “permission denied” page views, set LogPermissionDeniedAsaPageView to true. To deactivate it, set this value to false.
You can specify the number of days site stats are stored in the database via the Clear Historic Site Stats option on the Site Manager > Framework settings > Site Stats settings screen. You can also set the Clear Historic Site Stats value by modifying the RemoveAfterNumberOfDays setting in the ICS_NET_STAT database.
Warning
Before modifying this setting, review the Suggestions for Clearing Historic Site Stats section for tips on minimizing the impact on your system.
To clear historic site stats:
Click the user icon and select Site Manager from the drop-down menu.
The system displays the Site Manager screen, with the Site settings tab selected.
Click the Framework settings tab.
Select Site stats from the drop-down list at the top of the screen.
In the Clear historic site stats section of the page, enter the number of days you want site stats to be stored in the database. The default value for this setting is 0, which means that the system will retain site stats indefinitely.
Click Save.