How do you forward logs to a remote syslog server with rsyslog?
IntermediateProductionLogs, Limits & High-Traffic Tuning
Answer
# /etc/rsyslog.d/90-forward.conf
*.* action(type="omfwd" target="logs.internal" port="514" protocol="tcp"
queue.type="LinkedList" queue.filename="fwdq"
queue.maxDiskSpace="1g" queue.saveOnShutdown="on"
action.resumeRetryCount="-1")
The disk-assisted queue buffers messages if the collector is down. Use TCP (or RELP/TLS for reliability and encryption) rather than UDP for anything important.
More on Logs, Limits & High-Traffic Tuning
How does log management work on a modern Linux server?BeginnerWhy centralize logs instead of reading them on each server?BeginnerWrite a logrotate config for an application log.BeginnerWhat is the difference between `copytruncate` and `create` + postrotate signal?IntermediateLogs rotated but disk usage did not drop. Why?IntermediateHow often does logrotate run, and why does `maxsize` sometimes not trigger in time?Intermediate