syslog-ng documentation

Your main source of knowledge

The syslog-ng product family has an extensive documentation, covering everything from how to install a product to the most complex configuration and settings descriptions. If you cannot find an answer to your question, try the mailing list - our community is always eager to help.

syslog-ng Open Source Edition


8.1. Log paths

Log paths determine what happens with the incoming log messages. Messages coming from the sources listed in the log statement and matching all the filters are sent to the listed destinations.

To define a log path, add a log statement to the syslog-ng configuration file using the following syntax:

log {
    source(s1); source(s2); ...
    destination(d1); destination(d2); ...
    flags(flag1[, flag2...]);

Log statements are processed in the order they appear in the configuration file, thus the order of log paths may influence what happens to a message, especially when using filters and log flags.


The order of filters, rewriting rules, and parsers in the log statement is important, as they are processed sequentially.

Example 8.1. A simple log statement

The following log statement sends all messages arriving to the localhost to a remote server.

source s_localhost { network(ip( port(1999)); };
destination d_tcp { network("" port(1999) localport(999)); };
log { source(s_localhost); destination(d_tcp); };

All matching log statements are processed by default, and the messages are sent to every matching destination by default. So a single log message might be sent to the same destination several times, provided the destination is listed in several log statements, and it can be also sent to several different destinations.

This default behavior can be changed using the flags() parameter. Flags apply to individual log paths, they are not global options. For details and examples on the available flags, see Section 8.1.3, Log path flags. The effect and use of the flow-control flag is detailed in Section 8.2, Managing incoming and outgoing messages with flow-control.