man: update syslogp.3 with latest changes for remote logging

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg 2022-08-01 11:34:09 +02:00
parent 460e26f0f2
commit 51ecc21973

View File

@ -29,7 +29,7 @@
.\" .\"
.\" @(#)syslog.3 8.1 (Berkeley) 6/4/93 .\" @(#)syslog.3 8.1 (Berkeley) 6/4/93
.\" .\"
.Dd March 22, 2017 .Dd August 1, 2022
.Dt SYSLOGP 3 .Dt SYSLOGP 3
.Os .Os
.Sh NAME .Sh NAME
@ -115,37 +115,47 @@ The
.Fn syslog_r .Fn syslog_r
function is a multithread-safe version of the function is a multithread-safe version of the
.Fn syslog .Fn syslog
function. function. It takes a pointer to a
It takes a pointer to a
.Fa syslog_data .Fa syslog_data
structure which is used to store structure which is used to store information. This parameter must be
information. initialized before
This parameter must be initialized before
.Fn syslog_r .Fn syslog_r
is called. is called. The
The
.Dv SYSLOG_DATA_INIT .Dv SYSLOG_DATA_INIT
constant is used for this purpose. constant is used for this purpose. The
The
.Fa syslog_data .Fa syslog_data
structure and the structure and the
.Dv SYSLOG_DATA_INIT .Dv SYSLOG_DATA_INIT
constant are defined as: constant are defined as:
.Bd -literal -offset indent .Bd -literal -offset indent
struct syslog_data { struct syslog_data {
int log_version;
int log_file; int log_file;
int connected; int log_connected;
int opened; int log_opened;
int log_stat; int log_stat;
const char *log_tag; const char *log_tag;
const char *log_sockpath;
char log_hostname[256];
int log_fac; int log_fac;
int log_mask; int log_mask;
struct sockaddr *log_host;
int log_pid;
}; };
#define SYSLOG_DATA_INIT { \e #define SYSLOG_DATA_INIT { \e
.log_version = 1, \e
.log_file = -1, \e .log_file = -1, \e
.log_connected = 0, \e
.log_opened = 0, \e
.log_stat = 0, \e
.log_tag = 0, \e
.log_sockpath = NULL, \e
.log_hostname = { '\\0' }, \e
.log_fac = LOG_USER, \e .log_fac = LOG_USER, \e
.log_mask = 0xff, \e .log_mask = 0xff, \e
.log_host = NULL, \e
.log_pid = -1, \e
} }
.Ed .Ed
.Pp .Pp
@ -153,9 +163,9 @@ The structure is composed of the following elements:
.Bl -tag -width connected -offset indent .Bl -tag -width connected -offset indent
.It Va log_file .It Va log_file
contains the file descriptor of the file where the message is logged contains the file descriptor of the file where the message is logged
.It Va connected .It Va log_connected
indicates if connect has been done indicates if connect has been done
.It Va opened .It Va log_opened
indicates if indicates if
.Fn openlog_r .Fn openlog_r
has been called has been called
@ -164,10 +174,24 @@ status bits, set by
.Fn openlog_r .Fn openlog_r
.It Va log_tag .It Va log_tag
string to tag the entry with string to tag the entry with
.It Va log_sockpath
UNIX domain socket used, can be changed by user
.It Va log_hostname
Hostname used, initialized to
.Fn gethostname
if unset, can be changed by user
.It Va log_fac .It Va log_fac
facility code facility code
.It Va log_mask .It Va log_mask
mask of priorities to be logged mask of priorities to be logged
.It Va log_host
.Va struct sockaddr *
host to send UDP message to, if set by user, enables logging to a remote
syslog server bypassing any local syslog server
.It Va log_pid
Process ID used in log message header. Can be changed by user, if unset
defaults to call
.Fn getpid
.El .El
.\" .Pp .\" .Pp
.\" The .\" The
@ -310,6 +334,8 @@ between the ident and the message.)
.It Dv LOG_PTRIM .It Dv LOG_PTRIM
Trim anything syslog added to the message before writing to Trim anything syslog added to the message before writing to
standard error output. standard error output.
.It Dv LOG_RFC3164
Use RFC3164 (BSD) style log messages, the default is new-style RFC5424.
.El .El
.Pp .Pp
The The