[syslog-ng] Fail safe test fot syslog-ng

dstuxo dstuxo at gmail.com
Tue Jan 15 12:50:20 CET 2008


Hi everyone,

I am using syslog-ng in a system which is supposed to be fail safe to avoid
data loss. However I encountered an unexpected delay and messages are lost..

To test it I am proceeding like this:

syslog-ng-config:

options {
    sync (0);
    time_reopen (10);
    log_fifo_size (1000);
    long_hostnames (off);
    use_dns (no);
    use_fqdn (no);
    create_dirs (no);
    keep_hostname (yes);
}
...
destination d_cron { file("/var/log/cron"); };
...

logger -t tester -p cron.info "power failure test" &
tail -f /var/log/cron

Waiting aprox. 2 seconds then I power down. The previous command shows the
message, but after reboot it is lost.
I supposed that it's happening due the fact that the buffers are not flushed
to disk. So I tried strace on syslog-ng process.
No read/write syscall for the message is made..

Another case is with a cycle of messages:
for i in `seq 1 1000`;do logger -t tester -p cron.info "power failure 
test: $i";echo ">> $i";done

After 3-4 seconds all messages are written. But not before that time...

I know about the fsync(yes) option and I tried it, but with high load of
messages It doesn't work proper (syslog-ng.config becomes corrupted and
messages are also lost)

There is something I am missing here? Configuration option, maybe?

Regards



More information about the syslog-ng mailing list