Syslog, rsyslogd: change output format to display log level and facilities

If ever you need to sort log messages by their log level yo may need to change the default output format of the syslog.
For rsyslog it’s located in /etc/rsyslogd.conf. Add these lines after the line “$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat” :

$template precise,”%timegenerated% %HOSTNAME% {%syslogpriority%,%syslogfacility%} %syslogtag% %msg%\n”
$ActionFileDefaultTemplate precise

Then restart rsyslogd:
sudo service rsyslog restart

#rsyslogd #syslog #log #loglevel #facilities