Automatically delete or archive log files based on file size


The PATROL KM for Log Management allows you to define recovery actions when a log file reaches a specified size. The available recovery actions for log files are:

  • Reduce the log file to 0 MB by deleting all the messages in the log file when the file reaches the size limit
  • Back up the file into the pmg_backup subdirectory located in the same directory as the monitored log file and reduce the log file to 0 MB

The backup file is written to the same directory with an incremental number appended to the log file name each time the file is backed up. For example, the first time that the error_log.txt reaches its size limit, PATROL creates a backup file named error_log.txt1. The next time that it reaches its limit, PATROL creates a backup file named error_log.txt2 and so on.

Note

It is recommended that you periodically move the backup files to another location. The PATROL recovery action checks to make sure that the backup file name is not already in use. If hundreds or even thousands of backup files exist in the log directory, PATROL may take some time to complete this recovery action.

  1. Access the LOG application menu as described in Accessing KM menu commands.
  2. Select Configure Size Actions from the Advanced Feature submenu of a LOGT application instance. The Configure-Size-Actions-dialog-box is displayed.
  3. In the Size Limit text box, enter the number of bytes that the monitored file must exceed before the recovery action is executed. For example, if the limit is 100 bytes, enter 100 in the Size Limit text box.
  4. Choose one of the following Actionoptions to specify a recovery action for PATROL to take when the log file reaches the specified size limit:
    • Nothing – PATROL continues monitoring the log file but does not attempt to reduce its size.
    • Delete – PATROL reduces the log file to 0 MB by deleting all the messages in the log file when the file reaches the size limit.
    • Backup and Delete – PATROL takes a backup of the existing log file and reduces the log file to 0 MB
  5. Click either the Yes or No options to indicate whether PATROL should run the recovery action in the attended mode and prompt an operator to respond to recovery actions that require confirmation.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*