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 (also known as "Report ID") for the particular data being loaded. The Load ID is a required parameter for the Remove Report (RMVRPTOND) and Print Report (PRTRPTOND) commands.

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. For more information on that option see the information later in the ARSDOC DELETE section.

Be sure to save any system log files before you perform any cleanup activities. The first system log that Content Manager 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 of the messages that are not message 87 and that were logged between Dec 1, 2016 and Dec 31, 2016:
$
> arsdoc delete -v -h QUSROND -f "System Log" -i "WHERE ODDAT_time_stamp BETWEEN '2016-12-01 00:00:00.000000' AND '2016-12-31 23:59:59.999999' AND NOT(MSG_NUM = 87)"
    2017-08-31 13:51:56.049792: ARS6108I Starting arsdoc.  Version:  10.5.0.0
2017-08-31 13:51:56.051800: ARS6165I QRDARS/ARSDOC delete -v -h QUSROND -f System Log -i WHERE ODDAT_time_stamp BETWEEN '2016-12-01 00:00:00.000000' AND '2016-12-31 23:59:59.999999' AND NOT(MSG_NUM = 87) 
2017-08-31 13:51:56.071016: ARS6062I Searching for folder 'System Log' ...  
2017-08-31 13:51:56.093824: ARS6084I Search successful 
2017-08-31 13:51:56.094040: ARS6063I Searching for documents in 'System Log' ... 
2017-08-31 13:51:56.094168: ARS6117I Querying database with SQL string 'WHERE ODDAT_time_stamp BETWEEN '2016-12-01 00:00:00.000000' AND '2016-12-31 23:59:59.999999' AND NOT(MSG_NUM = 87)' 
2017-08-31 13:51:57.822832: ARS6084I Search successful 
2017-08-31 13:51:57.823064: ARS6064I Deleting 3885 documents
2017-08-31 13:52:00.338768: ARS6090I Delete successful 
2017-08-31 13:52:00.341928: ARS6026I arsdoc completed. 

If you prefer to limit the delete to specific system log tables, you can specify the -S parameter. When you specify the -S parameter, the ARSDOC program searches only tables that contain a segment within the specified date range. You can optionally specify a date format. An example of a date range with a date format is: -S "01.01.2016,12.31.2016,%m.%d.%Y".

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 Content Manager 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 Content Manager OnDemand activities create entries in the system log. To select which activities create system log entries for a Content Manager OnDemand server:
  1. Log on to the server with the 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 Content Manager OnDemand activities you want to log within the System Logging and User Exit Logging boxes.