.Dt SYSLOG 3
.Os
.Sh NAME
-.Nm syslog ,
-.Nm vsyslog ,
-.Nm openlog ,
.Nm closelog ,
-.Nm setlogmask
+.Nm openlog ,
+.Nm setlogmask ,
+.Nm syslog ,
+.Nm vsyslog
.Nd control system log
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
.In syslog.h
-.In stdarg.h
.Ft void
-.Fn syslog "int priority" "const char *message" "..."
+.Fo closelog
+.Fa void
+.Fc
.Ft void
-.Fn vsyslog "int priority" "const char *message" "va_list args"
+.Fo openlog
+.Fa "const char *ident"
+.Fa "int logopt"
+.Fa "int facility"
+.Fc
+.Ft int
+.Fo setlogmask
+.Fa "int maskpri"
+.Fc
.Ft void
-.Fn openlog "const char *ident" "int logopt" "int facility"
+.Fo syslog
+.Fa "int priority"
+.Fa "const char *message"
+.Fa "..."
+.Fc
+.In syslog.h
+.In stdarg.h
.Ft void
-.Fn closelog void
-.Ft int
-.Fn setlogmask "int maskpri"
+.Fo vsyslog
+.Fa "int priority"
+.Fa "const char *message"
+.Fa "va_list args"
+.Fc
.Sh DESCRIPTION
The
.Fn syslog
.Xr strerror 3 . )
A trailing newline is added if none is present.
.Pp
+Newlines and other non-printable characters embedded in the message string are printed in an alternate format.
+This prevents someone from using non-printable characters to construct misleading log messages in an output file.
+Newlines are printed as "\\n",
+tabs are printed as "\\t".
+Other control characters are printed using a caret ("^") representation, for example "^M" for carriage return.
+.Pp
The
.Fn vsyslog
function
.Dv LOG_AUTH ,
but logged to a file readable only by
selected individuals.
-.It Dv LOG_CONSOLE
-Messages written to
-.Pa /dev/console
-by the kernel console output driver.
.It Dv LOG_CRON
The cron daemon:
.Xr cron 8 .
These cannot be generated by any user processes.
.It Dv LOG_LPR
The line printer spooling system:
-.Xr lpr 1 ,
-.Xr lpc 8 ,
-.Xr lpd 8 ,
+.Xr cups-lpd 8 ,
+.Xr cupsd 8 ,
etc.
.It Dv LOG_MAIL
The mail system.
The routines
.Fn closelog ,
.Fn openlog ,
-.Fn syslog
+.Fn syslog ,
and
.Fn vsyslog
return no value.
syslog(LOG_INFO|LOG_LOCAL2, "foobar error: %m");
.Ed
+.Sh LEGACY SYNOPSIS
+.Fd #include <syslog.h>
+.Fd #include <stdarg.h>
+.Pp
+These include files are necessary for all functions.
.Sh SEE ALSO
+.Xr asl 3 ,
.Xr logger 1 ,
+.Xr compat 5 ,
.Xr syslogd 8
.Sh HISTORY
These
.Pp
Always use the proper secure idiom:
.Pp
-.Dl syslog("%s", string);
+.Bd -literal -offset indent -compact
+syslog(LOG_ERR, "%s", string);
+.Ed