Configure `rsyslog`

Today, I configured rsyslog on Ubuntu server to collect logs from remote application server.

syslog using UDP seems straight forward, but I wanted to set up using TCP (TCP being more reliable and all)

At first, it did not work because I needed to tell SysLogHandler that we are using TCP using SOCK_STREAM as optional param. (Default is UDP) So in a standalone test script, remote logging worked.

Turns out because of how TCP works, the logs are not flushed to the remote server till the application server closes the socket connection.

Continue Reading »