about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--vlogger.820
-rw-r--r--vlogger.c5
2 files changed, 17 insertions, 8 deletions
diff --git a/vlogger.8 b/vlogger.8
index 3a6b204..24a45c8 100644
--- a/vlogger.8
+++ b/vlogger.8
@@ -14,13 +14,15 @@
 .Sh DESCRIPTION
 The
 .Nm
-utility writes messages to the system log.
+utility writes messages to the system log or an arbitrary executable.
 .Pp
-With
-.Ar message
-arguments
+If
 .Nm
-will always write messages to the system log.
+is executed as
+.Nm logger
+it will always use the system log and behave like the regular
+.Xr logger 1 .
+.Pp
 Without
 .Ar message
 arguments
@@ -36,8 +38,10 @@ executable exists
 .Nm
 executes it with
 .Ar tag ,
-level
-and priority as arguments,
+.Ar level
+and
+.Ar facility
+as arguments,
 replacing the
 .Nm
 process.
@@ -117,7 +121,7 @@ environment variable.
 .It Ar message
 Write the
 .Ar message
-to the log.
+to the system log.
 .El
 .Sh FACILITIES
 .Bl -tag -width 11n -compact
diff --git a/vlogger.c b/vlogger.c
index e61f601..801c1d3 100644
--- a/vlogger.c
+++ b/vlogger.c
@@ -6,6 +6,8 @@
 #include <unistd.h>
 #include <limits.h>
 
+extern char *__progname;
+
 static char pwd[PATH_MAX];
 
 typedef struct {
@@ -99,6 +101,9 @@ main(int argc, char *argv[])
 				level = LOG_NOTICE;
 			}
 		}
+	} else if (strcmp(__progname, "logger") == 0) {
+		/* behave just like logger(1) and only use syslog */
+		Sflag++;
 	}
 
 	while ((c = getopt(argc, argv, "f:ip:Sst:")) != -1)