Mstdlib-1.24.0
|
Functions | |
M_log_error_t | M_log_module_add_tcp_syslog (M_log_t *log, const char *product, M_syslog_facility_t facility, const char *host, M_uint16 port, M_dns_t *dns, size_t max_queue_bytes, M_log_module_t **out_mod) |
M_log_error_t | M_log_module_tcp_syslog_set_connect_timeout_ms (M_log_t *log, M_log_module_t *module, M_uint64 timeout_ms) |
M_log_error_t | M_log_module_tcp_syslog_set_keepalives (M_log_t *log, M_log_module_t *module, M_uint64 idle_time_s, M_uint64 retry_time_s, M_uint64 retry_count) |
M_log_error_t | M_log_module_tcp_syslog_set_tag_priority (M_log_t *log, M_log_module_t *module, M_uint64 tags, M_syslog_priority_t priority) |
Functions to enable logging to a remote syslog server over TCP.
This module formats messages according to the legacy BSD syslog format from RFC 3164, and adds octet-counting framing as described in RFC 6587 for transmission over TCP. This legacy format was chosen to ensure compatibility across a wide range of syslog servers.
Messages are written asynchronously, as part of an existing event loop owned by the caller.
Note: syslog messages are limited to 1024 chars / line. Lines longer than this will be truncated.
M_log_error_t M_log_module_add_tcp_syslog | ( | M_log_t * | log, |
const char * | product, | ||
M_syslog_facility_t | facility, | ||
const char * | host, | ||
M_uint16 | port, | ||
M_dns_t * | dns, | ||
size_t | max_queue_bytes, | ||
M_log_module_t ** | out_mod | ||
) |
Add a module to output to a remote syslog server over TCP.
This module formats messages according to the legacy BSD syslog format from RFC 3164, and adds octet-counting framing as described in RFC 6587 for transmission over TCP. This legacy format was chosen to ensure compatibility across a wide range of syslog servers.
Note: syslog messages are limited to 1024 chars / line. Lines longer than this will be truncated.
[in] | log | logger object |
[in] | product | short tag string for syslog, usually the name of the program sending log info |
[in] | facility | facility type to associate with all log messages, gets passed directly to syslog |
[in] | host | hostname of destination syslog server |
[in] | port | port of destination syslog server (usually 514) |
[in] | dns | external DNS resolver cache to use (not owned by logger) |
[in] | max_queue_bytes | max size of queue used to buffer asynchronous writes to syslog |
[out] | out_mod | handle for created module, or NULL if there was an error |
M_log_error_t M_log_module_tcp_syslog_set_connect_timeout_ms | ( | M_log_t * | log, |
M_log_module_t * | module, | ||
M_uint64 | timeout_ms | ||
) |
Set TCP connection timeout.
Note that, in addition to normal connection parameters, the TCP module will automatically try to reconnect on disconnect or error after a short delay, no matter what you set here.
[in] | log | logger object |
[in] | module | handle of module to operate on |
[in] | timeout_ms | connection timeout, in milliseconds |
M_log_error_t M_log_module_tcp_syslog_set_keepalives | ( | M_log_t * | log, |
M_log_module_t * | module, | ||
M_uint64 | idle_time_s, | ||
M_uint64 | retry_time_s, | ||
M_uint64 | retry_count | ||
) |
Set TCP keep alive parameters for the connection.
If this function isn't called, the following default values are used:
idle_time_s = 4 seconds
retry_time_s = 15 seconds
retry_count = 3
[in] | log | logger object |
[in] | module | handle of module to operate on |
[in] | idle_time_s | tcp idle timeout, in seconds |
[in] | retry_time_s | tcp retry time, in seconds |
[in] | retry_count | tcp allowed number of retries |
M_log_error_t M_log_module_tcp_syslog_set_tag_priority | ( | M_log_t * | log, |
M_log_module_t * | module, | ||
M_uint64 | tags, | ||
M_syslog_priority_t | priority | ||
) |
Associate the given user-defined tag(s) with a syslog priority tag.
If you don't associate a tag with a syslog priority, the default priority of M_SYSLOG_INFO will be used for that tag.
[in] | log | logger object |
[in] | module | handle of module to operate on |
[in] | tags | user-defined power-of-two tag (or multiple power-of-two tags, OR'd together) |
[in] | priority | single priority value to associate with the given tags |