Configure TRA Log Rotation

Use the logrotate utility to rotate Traffic Routing Agent (TRA) MATRIXX Engine mtx_debug.log log file. The rotation compresses the current log file for archiving and removes it. The log volume and current date are used to determine if the log files must be rotated.

About this task

You can configure the log rotation operation to occur daily, weekly, monthly, or when the file grows too large. By default, MATRIXX Engine checks and rotates the mtx_debug.log file on a daily basis at midnight or when the file size reaches 500MB and archives seven logs before rotating them. In other words, when the mtx_debug.log file reaches the trigger point, it is saved to a debug.log1 file, and all later messages are written to the mtx_debug.log file. When the trigger point occurs again, debug.log1 is saved to debug.log2 and mtx_debug.log is saved to debug.log1. With each new log file created, each existing log is saved as the next oldest log until log6 is saved to log7. Because the rotate is set to 7, the contents of the most recent log7 file are deleted and not saved to a log8.

The messages generated by each MATRIXX process are consolidated into one log file and saved on the pod where the service is running. You can configure the logrotate utility to copy the log files generated for each pod to a central location.

In the case of TRA-PROC servers that are collocated on MATRIXX Engine, this task assumes you are making changes to an engine that is online and in production. In such cases, you must perform this procedure on an engine running in standby mode. If you are making changes to an offline engine, you need not perform any steps after running the configure_engine.py script, except to run the script again on the other engines. If you are making changes to a single engine, you need not perform any steps after running the configure_engine.py script.

For more information about the MATRIXX environment variables, see the discussion about installation directories, navigation shortcuts, and environment variables in MATRIXX Installation and Upgrade.

Procedure

  1. Open the ${MTX_DATA_DIR}/logrotate_mtx.conf file.
  2. Change all references to this directory:
    /var/log/mtx
    to the TRA equivalent:
    /var/log/tra
  3. Change any other required configuration parameters. For information about the logrotate_mtx.conf parameters and example settings, see the discussion about logrotate_mtx.conf file.
  4. Save and close the file.
  5. Enter the following command to copy the logrotate_mtx.conf file to the /etc/logrotate.d/mtx directory:
    sudo cp ${MTX_DATA_DIR}/logrotate_mtx.conf/etc/logrotate.d/tra
  6. If you are making these changes on to TRA-PROC servers collocated on a MATRIXX Engine chain, repeat these steps on all engines to keep the configurations the same.