Is asynchronous file logging supported with rsyslog?

Solution Verified - Updated -

Issue

Is asynchronous file logging supported with rsyslog?

A feature of rsyslog that allows you to skip syncing after every log entry is undocumented in the rsyslog.conf man page of RHEL6.4's rsyslog-5.8.10-6.el6 package. The feature is documented at http://www.rsyslog.com/doc/rsyslog_conf_actions.html:

You may prefix each entry with the minus '-' sign to omit syncing the file after every logging. Note that you might lose information if the system crashes right behind a write attempt. Nevertheless this might give you back some performance, especially if you run programs that use logging in a very verbose manner.

It seems that the version packaged does have this functionality. This can be verified by downloading and unpacking http://ftp.redhat.com/pub/redhat/linux/enterprise/6Server/en/os/SRPMS/rsyslog-5.8.10-6.el6.src.rpm. Once unpacked, examination of tools/omfile.c in the source directory, specifically lines 742 - 747, reveals some implements of the feature:

    if(*p == '-') {
        pData->bSyncFile = 0;
        p++;
    } else {
        pData->bSyncFile = bEnableSync;
    }

Environment

Red Hat Enterprise Linux (RHEL) 6.4

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.