Configuring the log file rotation

Log and trace files can become large in size. The logrotate service is used by the Bridge deployment to store the most recent information and to ensure that the files are maintained at a reasonable size.

Default log and trace files are preconfigured for logrotate. However, if you want to use different trace or log file path names or if have new settings, you can change the logrotate configuration.

You can also change the logrotate parameters for each file.

  1. To change the logrotate configuration, edit /etc/logrotate.d/imabridge as root or by using sudo. Both the default log and trace files are listed in the configuration file. If either file name path needs to change, then update the corresponding full path name.
  2. You can modify any of the following the logrotate parameters for each file:
    • size. Log files are rotated only if they grow bigger than the specified size bytes. If size is followed by a 'k', the size is assumed to be in kilobytes. If the value 'M' is used, the size is in megabytes, and if 'G' is used, the size is in gigabytes. For example, size 100, size 100k, size 100M and size 100G are all valid values.
    • rotate count. Log files are rotated the specified number of times before being removed or mailed to the address that is specified in a mail directive. If the count is set to 0, old versions are removed rather than rotated.
    • compress. Old versions of log files are compressed with gzip by default.
    • notifempty. The log is not rotated if it is empty.
    • missingok. If the log file is missing, the next log file is used and no error message is issued.
    • copytruncate. Truncates the original log file that is in place after creating a copy, rather than moving the old log file and optionally creating a new one. Use this parameter when a program cannot close its logfile and might continue writing to the previous log file.
      Note: There is a small time slice between copying the file and truncating it, so some logging data might be lost. When this option is used, the create option has no effect because the old log file stays in place.

    For more information, see the logrotate section of the Linux manual page.