Filtering logging

If you find that a particular event is occurring frequently and so the log file is filling up with many instances of the same log message, you can set a filter to specify that one or more specific log messages should be logged only once. Any subsequent instances of the same log message will be ignored and will not be written to the log file. This filtering applies to all types of logs: audit, exception, and problem logs.

If you are using central logging, you set up the filter on the server that is acting as the central logger. This means that the message will be written to file only once, even if it occurs on two or more different servers. You are recommended to duplicate the filter on any other servers that can act as backup servers, so that the filtering will continue if the central logger is stopped and another server takes over. In addition, you can set this filter on a Remote API Client; this means that the specified message will be sent to the central logger only once from this client.

If you are not using central logging, you can set the filter on each server or Remote API Client, so that the message will be logged only once on that system. There is no need to set up the same filtering options on all servers and clients; you can set the filter or leave it unset on each server or client according to your requirements..

To set up a filter for one or more log messages, create an ASCII file logfilter.txt in the following directory:

  • On Linux Remote API Clients: /etc/opt/ibm/sna
  • On AIX servers or AIX Remote API Clients: /etc/sna
  • On Windows Remote API Clients: the directory specified in the Logging / log_directory parameter in the Windows Registry. If this parameter is not specified, the default is the Remote API Client's install directory (for example c:\ibmcs\w32cli).

Each line in this file contains the message number of a particular log message that you want to filter. Specify this as two numbers separated by a hyphen (dash) character, as described in Verbose logging message format. For example:

1024-15
2048-12
512-16

You can include a maximum of 20 message numbers in this file. If you include more, only the message numbers specified in the first 20 lines of the file are filtered, and the remaining lines in the file are ignored.

This file is read when the CS/AIX software is started on the server or client containing the file.

  • If you create a new logfilter.txt file or modify the existing file, you will need to stop and restart the CS/AIX software on the server or client containing the file for your changes to take effect.
  • The count for each filtered log message is reset when the CS/AIX software is stopped and restarted, or when the server acting as the central logger is stopped and another server takes over. This means that the message is logged only once for each run of the CS/AIX softwareor each time a server takes over as the central logger.