Change the Default rsyslog Behavior

The rsyslog utility logs all messages for a MATRIXX process to a single file named mtx.log. It also logs all CRITICAL messages to /var/log/messages by default. Change the default behavior to log messages of different levels to separate files.

Before you begin

The rsyslog utility is installed by default with the Red Hat Enterprise Linux (RHEL) operating system. For information about configuring rsyslog for Red Hat, see the Red Hat Enterprise Deployment Guide and the rsyslog website. Follow these steps to set up the package for MATRIXX Engine.

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

About this task

Perform this task on each server in all engines.

Procedure

  1. Open the ${MTX_DATA_DIR}/rsyslog_mtx.conf file with a text editor.
  2. Locate the following comment, which precedes the logging specification:
    # Logging for MATRIXX system.
  3. To log messages of different levels to separate log files, use local0. as the prefix for the log filename. Local0 is the facility that MATRIXX uses to send messages to the rsyslog utility. Append this prefix with any of the following extensions:
    • An asterisk (*) — Records all messages to the specified file. This is the default configuration.
    • criti — Records critical messages to the specified file.
    • err — Records error messages to the specified file.
    • warn — Records warning messages to the specified file.
    • info — Records info messages to the specified file. This is the default.
    • debug — Records debug messages to the specified file.
    For example, to write messages for each different log level to a separate file (instead of consolidating them into one mtx.log file), remove the local0.* specification. Then, add the following lines after the Logging comment, where system_log_dir is the system log directory.
    Note: This directory should be different from the transaction logs directory.
    local0.criti /system_log_dir/mtx_critical.log
    local0.err /system_log_dir/mtx_error.log
    local0.warn /system_log_dir/mtx_warning.log
    local0.info /system_log_dir/mtx_info.log
    Note: Messages from the MATRIXX Process Controller are always written to a separate log file called process_ctrl.log.
  4. (Optional) Comment out the following line to have messages written to both the default system log file and the debug log file:
    & stop
    Note: This is not recommended because it involves extra processing that can slow down performance.
  5. Save and close the rsyslog_mtx.conf file.
  6. In a terminal, enter the following command to copy the rsyslog_mtx.conf file to /etc/rsyslog.d/20-mtx.conf.
    cp ${MTX_DATA_DIR}/rsyslog_mtx.conf /etc/rsyslog.d/20-mtx.conf
  7. If you specified a new log directory, enter the following commands to create the directory and to set the owner and group permissions on it to mtx. Replace directory_path with the full path of the directory.
    mkdir directory_path
    sudo chown -R mtx directory_path
    sudo chgrp -R mtx directory_path

What to do next

Perform this procedure on all other servers in the engine. Optionally, secure copy the rsyslog configuration file from this server to all other servers and then specify the new log directory, if necessary.