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); ...
optional_element(filter1|parser1|rewrite1); optional_element(filter2|parser2|rewrite2);...
destination(d1); destination(d2); ...
flags(flag1[, flag2...]);
};
![]() |
Warning |
|---|---|
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. |
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. The
following flags available in syslog-ng:
final: Do not send the messages processed by this log path to any further destination.
fallback: Process messages that were not processed by other log paths.
catchall: Process every message, regardless of its source or if it was already processed by other log paths.
flow-control: Stop reading messages from the source if the destination cannot accept them. See Section 2.13, “Managing incoming and outgoing messages with flow-control”.
![]() |
Warning |
|---|---|
The |
For details on the individual flags, see Section 8.3, “Log path flags”. The
effect and use of the flow-control flag is detailed in Section 2.13, “Managing incoming and outgoing messages with flow-control”.
Embedded log statements (see Section 2.2.1, “Embedded log statements” ) re-use the results of processing messages (e.g., the results of filtering or rewriting) to create complex log paths. Embedded log statements use the same syntax as regular log statements, but they cannot contain additional sources. To define embedded log statements, use the following syntax:
log {
source(s1); source(s2); ...
optional_element(filter1|parser1|rewrite1);
optional_element(filter2|parser2|rewrite2);...
destination(d1); destination(d2); ...
flags(flag1[, flag2...]);
#embedded log statement
log
{
optional_element(filter1|parser1|rewrite1);
optional_element(filter2|parser2|rewrite2);...
destination(d1); destination(d2); ...
#another embedded log statement
log
{
optional_element(filter1|parser1|rewrite1);
optional_element(filter2|parser2|rewrite2);...
destination(d1); destination(d2); ...};
};
};
![]() |
Warning |
|---|---|
The |
For details on how flow-control works, see Section 2.13, “Managing incoming and outgoing messages with flow-control”. The summary of the main points is as follows:
The syslog-ng application normally reads a maximum of
log_fetch_limit() number of messages from a
source.
From TCP and unix-stream sources, syslog-ng reads a maximum of
log_fetch_limit() from every connection of the
source. The number of connections to the source is set using the
max_connections() parameter.
Every destination has an output buffer
(log_fifo_size()).
Flow-control uses a control window to determine if there is free space in
the output buffer for new messages. Every source has its own control window;
log_iw_size() parameter sets the size of the
control window.
When a source accepts multiple connections, the messages of every connection use the same control window.
The output buffer must be larger than the control window of every source that logs to the destination.
If the control window is full, syslog-ng stops reading messages from the source until some messages are successfully sent to the destination.
If the output buffer becomes full, and neither disk-buffering nor flow-control is used, messages may be lost.
![]() |
Note |
|---|---|
If you modify the |
See also Section 7.2, “Handling lots of parallel connections”.
© 2007-2008 BalaBit IT Security
Please send your comments or documentation bugs to: documentation@balabit.com