stdout: Send messages to standard output
Available in AxoSyslog version 4.4 and later.
The stdout()
destination driver sends messages to the standard output.
Declaration:
log {
source{ stdin(); };
destination{ stdout(); };
};
Options
flags()
Type: | no-multi-line, syslog-protocol |
Default: | empty set |
Description: Flags influence the behavior of the destination driver.
- no-multi-line: The
no-multi-line
flag disables line-breaking in the messages: the entire message is converted to a single line. - syslog-protocol: The
syslog-protocol
flag instructs the driver to format the messages according to the new IETF syslog protocol standard (RFC5424), but without the frame header. If this flag is enabled, macros used for the message have effect only for the text of the message, the message header is formatted to the new standard. Note that this flag is not needed for thesyslog
driver, and that thesyslog
driver automatically adds the frame header to the messages.
flush-lines()
Type: | number |
Default: | Use global setting (exception: for http() destination, the default is 1). |
Description: Specifies how many lines are flushed to a destination at a time. The AxoSyslog application waits for this number of lines to accumulate and sends them off in a single batch. Increasing this number increases throughput as more messages are sent in a single batch, but also increases message latency.
The AxoSyslog application flushes the messages if it has sent flush-lines()
number of messages, or the queue became empty. If you stop or reload AxoSyslog or in case of network sources, the connection with the client is closed, AxoSyslog automatically sends the unsent messages to the destination.
For optimal performance when sending messages to an AxoSyslog server, make sure that the value of flush-lines()
is smaller than the window size set in the log-iw-size()
option in the source of your server.
flush-timeout()
Type: | time in milliseconds |
Default: | 10000 [milliseconds] |
Description: Specifies the time AxoSyslog waits for lines to accumulate in the output buffer. The AxoSyslog application sends flushes to the destinations evenly. The timer starts when the first message arrives to the buffer, so if only few messages arrive, AxoSyslog sends messages to the destination at most once every flush-timeout()
seconds.
frac-digits()
Type: | number |
Default: | 0 |
Description: The AxoSyslog application can store fractions of a second in the timestamps according to the ISO8601 format. The frac-digits()
parameter specifies the number of digits stored. The digits storing the fractions are padded by zeros if the original timestamp of the message specifies only seconds. Fractions can always be stored for the time the message was received.
frac-digits()
option is set to a value higher than 6, AxoSyslog will truncate the fraction seconds in the timestamps after 6 digits.
local-time-zone()
Type: | name of the timezone, or the timezone offset |
Default: | The local timezone. |
Description: Sets the timezone used when expanding filename and tablename templates.
The timezone can be specified by using the name, for example, time-zone("Europe/Budapest")
), or as the timezone offset in +/-HH:MM format, for example, +01:00
). On Linux and UNIX platforms, the valid timezone names are listed under the /usr/share/zoneinfo
directory.
log-fifo-size()
Type: | number |
Default: | Use global setting. |
Description: The number of messages that the output queue can store.
mark-freq()
Accepted values: | number [seconds] |
Default: | 1200 |
Description: An alias for the obsolete mark()
option, retained for compatibility with version 1.6.x.
The number of seconds between two MARK
messages. MARK
messages are generated when there was no message traffic to inform the receiver that the connection is still alive. If set to zero (0
), no MARK
messages are sent. The mark-freq()
can be set for global option and/or every MARK
capable destination driver if mark-mode()
is periodical or dst-idle or host-idle. If mark-freq()
is not defined in the destination, then the mark-freq()
will be inherited from the global options. If the destination uses internal mark-mode()
, then the global mark-freq()
will be valid (does not matter what mark-freq()
set in the destination side).
mark-mode()
Accepted values: | internal | dst-idle | host-idle | periodical | none | global |
Default: |
|
Description: The mark-mode()
option can be set for the following destination drivers: file(), program(), unix-dgram(), unix-stream(), network(), pipe(), syslog() and in global option.
-
internal
: When internal mark mode is selected, internal source should be placed in the log path as this mode does not generate mark by itself at the destination. This mode only yields the mark messages from internal source. This is the mode as AxoSyslog 3.3 worked.MARK
will be generated by internal source if there was NO traffic on local sources:file()
,pipe()
,unix-stream()
,unix-dgram()
,program()
-
dst-idle
: SendsMARK
signal if there was NO traffic on destination drivers.MARK
signal from internal source will be dropped.MARK
signal can be sent by the following destination drivers:network()
,syslog()
,program()
,file()
,pipe()
,unix-stream()
,unix-dgram()
. -
host-idle
: SendsMARK
signal if there was NO local message on destination drivers. for example,MARK
is generated even if messages were received from tcp.MARK
signal from internal source will be dropped.MARK
signal can be sent by the following destination drivers:network()
,syslog()
,program()
,file()
,pipe()
,unix-stream()
,unix-dgram()
. -
periodical
: SendsMARK
signal perodically, regardless of traffic on destination driver.MARK
signal from internal source will be dropped.MARK
signal can be sent by the following destination drivers:network()
,syslog()
,program()
,file()
,pipe()
,unix-stream()
,unix-dgram()
. -
none
: Destination driver drops allMARK
messages. If an explicit mark-mode() is not given to the drivers wherenone
is the default value, thennone
will be used. -
global
: Destination driver uses the globalmark-mode()
setting. Note that setting the globalmark-mode()
to global causes a syntax error in AxoSyslog.
dst-idle
, host-idle
and periodical
, the MARK
message will not be written in the destination, if it is not open yet.
Available in AxoSyslog 3.4 and later.
pad-size()
Type: | number |
Default: | 0 |
Description: If set, AxoSyslog will pad output messages to the specified size (in bytes). Some operating systems (such as HP-UX) pad all messages to block boundary. This option can be used to specify the block size. (HP-UX uses 2048 bytes).
pad-size()
value, AxoSyslog will truncate the message to the specified size. Therefore, all message content above that size will be lost.
persist-name()
Type: | string |
Default: | N/A |
Description: If you receive the following error message during AxoSyslog startup, set the persist-name()
option of the duplicate drivers:
Error checking the uniqueness of the persist names, please override it with persist-name option. Shutting down.
This error happens if you use identical drivers in multiple sources, for example, if you configure two file sources to read from the same file. In this case, set the persist-name()
of the drivers to a custom string, for example, persist-name("example-persist-name1")
.
send-time-zone()
Accepted values: | name of the timezone, or the timezone offset |
Default: | local timezone |
Description: Specifies the time zone associated with the messages sent by syslog-ng
, if not specified otherwise in the message or in the destination driver. For details, see Timezones and daylight saving.
The timezone can be specified by using the name, for example, time-zone("Europe/Budapest")
), or as the timezone offset in +/-HH:MM format, for example, +01:00
). On Linux and UNIX platforms, the valid timezone names are listed under the /usr/share/zoneinfo
directory.
suppress()
Type: | seconds |
Default: | 0 (disabled) |
Description: If several identical log messages would be sent to the destination without any other messages between the identical messages (for example, an application repeated an error message ten times), AxoSyslog can suppress the repeated messages and send the message only once, followed by the Last message repeated n times.
message. The parameter of this option specifies the number of seconds AxoSyslog waits for identical messages.
template()
Type: | string |
Default: | A format conforming to the default logfile format. |
Description: Specifies a template defining the logformat to be used in the destination. Macros are described in Macros of AxoSyslog. Please note that for network destinations it might not be appropriate to change the template as it changes the on-wire format of the syslog protocol which might not be tolerated by stock syslog receivers (like syslogd
or syslog-ng
itself). For network destinations make sure the receiver can cope with the custom format defined.
template-escape()
Type: | yes or no |
Default: | no |
Description: Turns on escaping for the '
, "
, and backspace characters in templated output files. This is useful for generating SQL statements and quoting string contents so that parts of the log message are not interpreted as commands to the SQL server.
Note: Starting with AxoSyslog version 4.5,
template-escape(yes)
escapes the top-level template function in case of nested template functions.
throttle()
Type: | number |
Default: | 0 |
Description: Sets the maximum number of messages sent to the destination per second. Use this output-rate-limiting functionality only when using disk-buffer as well to avoid the risk of losing messages. Specifying 0
or a lower value sets the output limit to unlimited.
time-zone()
Type: | name of the timezone, or the timezone offset |
Default: | unspecified |
Description: Convert timestamps to the timezone specified by this option. If this option is not set, then the original timezone information in the message is used. Converting the timezone changes the values of all date-related macros derived from the timestamp, for example, HOUR
. For the complete list of such macros, see Date-related macros.
The timezone can be specified by using the name, for example, time-zone("Europe/Budapest")
), or as the timezone offset in +/-HH:MM format, for example, +01:00
). On Linux and UNIX platforms, the valid timezone names are listed under the /usr/share/zoneinfo
directory.
ts-format()
Type: | rfc3164, bsd, rfc3339, iso |
Default: | rfc3164 |
Description: Override the global timestamp format (set in the global ts-format()
parameter) for the specific destination. For details, see ts-format().
network()
, or syslog()
) ignore this option. For protocol-like destinations, use a template locally in the destination, or use the proto-template option.