SCCS-vsn: usr.bin/logger/logger.1 6.4
SCCS-vsn: usr.bin/logger/logger.c 6.11
.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
.\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.\"
.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
.\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.\"
-.\" @(#)logger.1 6.3 (Berkeley) %G%
+.\" @(#)logger.1 6.4 (Berkeley) %G%
.\"
.TH LOGGER 1 ""
.UC 6
.\"
.TH LOGGER 1 ""
.UC 6
-.B \-t
-tag
-] [
-.B \-p
-pri
-] [
-.B \-i
+.B \-p
+pri
+] [
+.B \-t
+tag ] [ message ... ]
-.BI \-t \ tag
-Mark every line in the log with the specified
-.IR tag .
+.B \-i
+Log the process id of the logger process
+with each line.
+.TP
+.B \-s
+Log the message to standard error, as well as the system log.
+.TP
+.BI \-f \ file
+Log the specified file.
.TP
.BI \-p \ pri
Enter the message with the specified priority.
.TP
.BI \-p \ pri
Enter the message with the specified priority.
-The priority may be specified numerically
-or as a ``facility.level''
+The priority may be specified numerically or as a ``facility.level''
-For example, ``\-p local3.info''
-logs the message(s) as
+For example, ``\-p local3.info'' logs the message(s) as
.IR info rmational
level in the
.I local3
facility.
The default is ``user.notice.''
.TP
.IR info rmational
level in the
.I local3
facility.
The default is ``user.notice.''
.TP
-.B \-i
-Log the process id of the logger process
-with each line.
-.TP
-.BI \-f \ file
-Log the specified file.
+.BI \-t \ tag
+Mark every line in the log with the specified
+.IR tag .
.TP
message
The message to log; if not specified, and the \fB-f\fP flag is not
provided, standard input is logged.
.SH DESCRIPTION
.I Logger
.TP
message
The message to log; if not specified, and the \fB-f\fP flag is not
provided, standard input is logged.
.SH DESCRIPTION
.I Logger
-provides a program interface to the
+provides a shell command interface to the
.IR syslog (3)
system log module.
.SH EXAMPLES
.IR syslog (3)
system log module.
.SH EXAMPLES
.PP
logger \-p local0.notice \-t HOSTIDM \-f /dev/idmc
.SH SEE ALSO
.PP
logger \-p local0.notice \-t HOSTIDM \-f /dev/idmc
.SH SEE ALSO
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)logger.c 6.10 (Berkeley) %G%";
+static char sccsid[] = "@(#)logger.c 6.11 (Berkeley) %G%";
#endif /* not lint */
#include <stdio.h>
#endif /* not lint */
#include <stdio.h>
char *tag, buf[1024], *getlogin();
tag = NULL;
char *tag, buf[1024], *getlogin();
tag = NULL;
- while ((ch = getopt(argc, argv, "f:ip:t:")) != EOF)
+ while ((ch = getopt(argc, argv, "f:ip:st:")) != EOF)
switch((char)ch) {
case 'f': /* file to log */
if (freopen(optarg, "r", stdin) == NULL) {
switch((char)ch) {
case 'f': /* file to log */
if (freopen(optarg, "r", stdin) == NULL) {
case 'p': /* priority */
pri = pencode(optarg);
break;
case 'p': /* priority */
pri = pencode(optarg);
break;
+ case 's': /* log to standard error */
+ logflags |= LOG_PERROR;
+ break;
case 't': /* tag */
tag = optarg;
break;
case 't': /* tag */
tag = optarg;
break;