Mstdlib-1.24.0
Syslog Module

Functions

M_log_error_t M_log_module_add_syslog (M_log_t *log, const char *product, M_syslog_facility_t facility, size_t max_queue_bytes, M_log_module_t **out_mod)
 
M_log_error_t M_log_module_syslog_set_tag_priority (M_log_t *log, M_log_module_t *module, M_uint64 tags, M_syslog_priority_t priority)
 

Detailed Description

Functions to enable logging to a local syslog server.

Only available on some platforms.

Note: syslog messages are limited to 1024 chars / line. Lines longer than this will be truncated.

Function Documentation

◆ M_log_module_add_syslog()

M_log_error_t M_log_module_add_syslog ( M_log_t log,
const char *  product,
M_syslog_facility_t  facility,
size_t  max_queue_bytes,
M_log_module_t **  out_mod 
)

Add a module to output to syslog (if supported by this platform).

Note: syslog messages are limited to 1024 chars / line. Lines longer than this will be truncated.

If the library wasn't compiled with syslog support, this function will return M_LOG_MODULE_UNSUPPORTED when called, and no module will be added to the logger.

Parameters
[in]loglogger object
[in]productshort tag string passed to syslog: if NULL, will be set to program name
[in]facilityfacility type to associate with all log messages, gets passed directly to syslog
[in]max_queue_bytesmax size of queue used to buffer asynchronous writes to syslog
[out]out_modhandle for created module, or NULL if there was an error
Returns
error code

◆ M_log_module_syslog_set_tag_priority()

M_log_error_t M_log_module_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.

If you don't associate a tag with a syslog priority, the default priority of M_SYSLOG_INFO will be used for that tag.

See also
M_LOG_ALL_TAGS
M_log_all_tags_lt
M_log_all_tags_lte
M_log_all_tags_gt
M_log_all_tags_gte
Parameters
[in]loglogger object
[in]modulehandle of module to operate on
[in]tagsuser-defined power-of-two tag (or multiple power-of-two tags, OR'd together)
[in]prioritysingle priority value to associate with the given tags
Returns
error code