Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make rsyslogd flush its buffers

I am running rsyslogd 5.8.6 on linux. Other systems on the network use it as a logger. Event rates are very low, and it often happens that the remote message is received, but does not get written out to the /var/log/syslog file until several minutes later.

I have an application that is watching the file and processes it as lines become available, and I need to respond faster to the incoming messages.

I can think of two approaches: either configure rsyslogd to have a zero-size cache buffer, or a 0.5 maximum delay before flushing its buffers, or use some shell command to tell rsyslogd "flush your buffer NOW". I have been unable to find how to do either.

like image 226
user3457334 Avatar asked Jun 08 '16 00:06

user3457334


1 Answers

cron job:

pkill -HUP rsyslogd

Check your man rsyslogd:

HUP This lets rsyslogd perform close all open files.

like image 131
user86077 Avatar answered Nov 02 '22 12:11

user86077