1LIBXO(3)                 BSD Library Functions Manual                 LIBXO(3)
2

NAME

4     xo_syslog, xo_vsyslog, xo_open_log, xo_close_log, xo_set_logmask — create
5     SYSLOG (RFC5424) log records using libxo formatting
6

LIBRARY

8     library “libxo”
9

SYNOPSIS

11     #include <libxo/xo.h>
12
13     void
14     xo_syslog(int pri, const char *name, const char *fmt, ...);
15
16     void
17     xo_vsyslog(int pri, const char *name, const char *fmt, va_list vap);
18
19     void
20     xo_close_log(void);
21
22     void
23     xo_open_log(const char *ident, int logstat, int logfac);
24
25     int
26     xo_set_logmask(int pmask);
27

DESCRIPTION

29     The xo_syslog() function creates log entries following the standard de‐
30     fined in RFC5424.  These messages are sent to the log syslogd(8) daemon,
31     where they can be filtered, forwarded, and archived.  libxo format
32     strings are used to create both the message text and the SD-PARAMS con‐
33     tent, containing name/value pairs that can be parsed by suitable automa‐
34     tion software.
35
36     Refer to xo_format(5) for basic information about formatting strings.
37     xo_syslog encodes all value fields at SD-PARAMS within the syslog mes‐
38     sage.  An exception is made for fields with the "{d:}" modifier; such
39     fields appear in the message text only, with fields with the "{e:}" modi‐
40     fier appear as SD-PARAMS, but not in the message text.
41
42     xo_vsyslog() accepts a va_list for additional flexibility.
43
44     xo_open_log(), xo_close_log(), and xo_set_logmask() are all analogous to
45     their libs counterparts, openlog(3), closelog(3), and setlogmask(3).  The
46     extra underscores in the names are unfortunate, but keep consistency in
47     libxo function names.
48

EXAMPLES

50               xo_syslog(LOG_LOCAL4 | LOG_NOTICE, "ID47",
51                         "{e:iut/%u}An {:event-source} {:event-id/%u} log entry",
52                         iut, source, id);
53

SEE ALSO

55     xo_syslog(3), xo_set_syslog_enterprise_id(3), xo_format(5), libxo(3)
56

HISTORY

58     The libxo library first appeared in FreeBSD 11.0.
59

AUTHORS

61     libxo was written by Phil Shafer <phil@freebsd.org>.
62
63

ADDITIONAL DOCUMENTATION

65     FreeBSD uses libxo version 1.6.0.  Complete documentation can be found on
66     github:
67
68           https://juniper.github.io/libxo/1.6.0/html/index.html
69
70     libxo lives on github as:
71
72           https://github.com/Juniper/libxo
73
74     The latest release of libxo is available at:
75
76           https://github.com/Juniper/libxo/releases
77

HISTORY

79     The libxo library was added in FreeBSD 11.0.
80

AUTHOR

82     Phil Shafer
83
84BSD                              July 20, 2015                             BSD
Impressum