Share & learn

Through Innovative Digital Library

How to send messages to rsyslog in RHEL7/CentOS7?

Can you share the syntax to send messages to rsyslog in RHEL7/CentOS7?


Posted by Jon Snow on April 23rd 2018 07:53 AM

"logger" command with "-p" option is used to send messages to rsyslog service. Without "-p" option it will send the messages to the facility user with severity notice by default. It is very useful to test the changes to the rsyslog configuration. "-p" - Enter the message into the log with specified priority. Priority may be specified numerically or as a facility level. For example - -p logs the message as informational in the local3 facility. "tail -1 /path/to/logfile" will display the latest entry of the log file. Lets send messages to rsyslogd that gets recorded in the /var/log/boot.log and /var/log/maillog log file, as shown below:

# logger -p mail.err "User is not authorize"

# tail -1 /var/log/maillog

# logger -p "Log message from stark"

# tail -1 /var/log/boot.log
Answer Question

Your email address will not be published. Required fields are marked *

  • Minimum 20 character

related questions

Most liked questions

Most answered questions

5ZBS Refresh
5ZBS Refresh
Forgot password
Ask a Question
Minimum 20 character
Minimum 20 character
Minimum 20 character
5ZBS Refresh