Configure MTX Log Rotation
MATRIXX uses the logrotate utility to rotate the MATRIXX Engine log files, including the mtx_debug.log, mtx_diameter_error.log, and mtx_mdc_gateway_error.log. The rotation involves compressing the files for archiving purposes and then removing them. The log volume and current date are used to determine if the log files need to be rotated.
About this task
This task assumes you are changing a MATRIXX Engine installation that is online, in production, and has multiple engines. In such cases, you must perform this procedure on an engine running in standby mode. If you are changing 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 changing a single engine, you need not perform any steps after running the configure_engine.py script.
The messages generated by each MATRIXX process are consolidated into one log file and saved where the server is running. You can configure the logrotate utility to copy the log files generated for each server to a central location.
Procedure
- Go to the /opt/mtx/data directory.
- Locate the logrotate_mtx.conf file.
- Edit the file, look at the configuration, and change any of the required configuration parameters as required. See the comments in the logrotate_mtx.conf file for information about the parameters. For example settings, see the discussion about the logrotate_mtx.conf file.
-
Save and close the file.
Note: By default, the configuration in the logrotate_mtx.conf file sets compression for mtx_debug.log.
-
Enter the following
command to copy the
logrotate_mtx.conf file to the
/etc/logrotate.d/mtx directory:
sudo cp /opt/mtd/data/logrotate_mtx.conf /etc/logrotate.d/mtx
-
By default,
logrotate
is executed daily. If you want to executelogrotate
more frequently (once every hour):- Locate the cron_hourly_logrotate_mtx file in the /opt/mtx/data directory.
- Enter the following
command to copy the
cron_hourly_logrotate_mtx file to the
/etc/cron.hourly directory:
sudo cp /opt/mtx/data/cron_hourly_logrotate_mtx /etc/cron.hourly/logrotate-mtx
- To change the execution interval for
logrotate
by typing the following command:systemctl restart crond
Log rotation will now occur on an hourly basis. - If your MATRIXX Engine installation includes one or more engines for disaster recovery, perform this task on those engines to keep the configurations the same. This is necessary if the active cluster fails and processing is switched to a standby cluster.