Reducing system log size

Another way to manage the space required for your system log data is to remove or limit messages in the log that are not important to you.

Perhaps you do not feel the need to keep every log entry for every document retrieval, every annotation addition, and every logoff, for example. However, you might choose to keep system log entries for message number 87, which indicates a successful load and contains the Load ID for the particular data being loaded (which is required for PRTRPTOND and RMVRPTOND as described earlier in this chapter).

Existing system log entries can be selectively deleted, using the ARSDOC DELETE API, run in the QSHELL environmenton your IBM® i server. An example is shown below, and assumes you are already in QSHELL at the time the API is executed. (See the IBM Content Manager OnDemand for i: Common Server Administration Guide for more details regarding the use of the ARSDOC DELETE API.) System log entries can also be limited such that only those you feel are important are ever logged at all. See below the ARSDOC DELETE example for more information on that option as well.

Be sure to save any system log files before you perform any cleanup activities. The first system log that OnDemand uses is a physical file named SL2, found in the instance library. When the SL2 file becomes full, the next system log file is automatically created and named SL3, and continues to be created and incremented by one as needed.

In the following example, use the ARSDOC DELETE function to delete all messages from the system log for the specified date range, except for system log message 87:
$
> arsdoc delete -h QUSROND -v -i "WHERE NOT(MSG_NUM = 87)" -G 'System Log'
-f 'System Log' -S 01.05.2007,10.05.2007,%d.%m%Y
06/06/07 11:30:39: Starting arsdoc.   Version: 7.2
06/06/07 11:30:39: QRDARS/ARSDOC delete -h QUSROND 	-v -i WHERE NOT(MSG_NUM = 87)
-G System Log -f System Log -S 01.05.2007,10.05.2007,%d%m%Y
06/06/07 11:30:39: Searching for folder 'System Log' ...
06/06/07 11:30:39: Search successful
06/06/07 11:30:39: Searching for documents in 'System Log' ...
06/06/07 11:30:39: Querying database with SQL string 'WHERE NOT(MSG_NUM = 87)'
06/06/07 11:30:41: Search successful
06/06/07 11:30:41: Deleting 6161 documents
06/06/07 11:30:45: Delete successful
06/06/07 11:30:41: arsdoc completed.
After you run ARSDOC DELETE to clean up your unneeded system log entries, Content Manager OnDemand reuses the space that had been used by the records you just deleted. Alternatively, you might choose to reorganize the system log files using the IBM i Reorganize Physical File Mbr (RGZPFM) command. For example, you could run RGZPFM instance_name/SL2 where instance_name is the name of your OnDemand instance. At a minimum, you might want to reorganize all but the most current system log file.
As a final step, you might want to limit what is sent to the system log in the future. The OnDemand Administrator Client allows you to select which OnDemand activities create entries in the system log. To select which activities create system log entries for an OnDemand server:
  1. Log on to the server with the Content Manager OnDemand Administrator Client.
  2. Right-click the server.
  3. From the pop-up menu, select System Parameters, to invoke the System Parameters dialog box.
  4. Select the OnDemand activities you want to log within the System Logging and User Exit Logging boxes.