24.5. Setting Up a Host Logging Server
Hosts generate and update log files, recording their actions and problems. Collecting these log files centrally simplifies debugging.
This procedure should be used on your centralized log server. You could use a separate logging server, or use this procedure to enable host logging on the Red Hat Virtualization Manager.
Setting up a Host Logging Server
Check to see if the firewall allows traffic on the
UDP 514port, and is open tosyslogservice traffic:firewall-cmd --query-service=syslog
# firewall-cmd --query-service=syslogCopy to Clipboard Copied! Toggle word wrap Toggle overflow If the output is
no, allow traffic on theUDP 514port with:firewall-cmd --add-service=syslog --permanent firewall-cmd --reload
# firewall-cmd --add-service=syslog --permanent # firewall-cmd --reloadCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a new
.conffile on the syslog server, for example,/etc/rsyslog.d/from_remote.conf, and add the following lines:template(name="DynFile" type="string" string="/var/log/%HOSTNAME%/%PROGRAMNAME%.log") RuleSet(name="RemoteMachine"){ action(type="omfile" dynaFile="DynFile") } Module(load="imudp") Input(type="imudp" port="514" ruleset="RemoteMachine")template(name="DynFile" type="string" string="/var/log/%HOSTNAME%/%PROGRAMNAME%.log") RuleSet(name="RemoteMachine"){ action(type="omfile" dynaFile="DynFile") } Module(load="imudp") Input(type="imudp" port="514" ruleset="RemoteMachine")Copy to Clipboard Copied! Toggle word wrap Toggle overflow Restart the
rsyslogservice:systemctl restart rsyslog.service
# systemctl restart rsyslog.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Log in to the hypervisor, and in the
/etc/rsyslog.confadd the following line:*.info;mail.none;authpriv.none;cron.none @<syslog-FQDN>:514
*.info;mail.none;authpriv.none;cron.none @<syslog-FQDN>:514Copy to Clipboard Copied! Toggle word wrap Toggle overflow Restart the rsyslog service on the hypervisor.
systemctl restart rsyslog.service
# systemctl restart rsyslog.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Your centralized log server is now configured to receive and store the messages and secure logs from your virtualization hosts.