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
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
Procedure
- Open the ${MTX_DATA_DIR}/rsyslog_mtx.conf file with a text editor.
-
Locate the following
comment, which precedes the logging specification:
# Logging for MATRIXX system.
-
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 theLogging
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. - An asterisk (
-
(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. - Save and close the rsyslog_mtx.conf file.
-
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
-
If you specified a new log directory,
enter the following commands to create the directory and to set the
owner
andgroup
permissions on it tomtx
. 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.