about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--vlogger.88
-rw-r--r--vlogger.c12
2 files changed, 17 insertions, 3 deletions
diff --git a/vlogger.8 b/vlogger.8
index cae3b12..aa7780f 100644
--- a/vlogger.8
+++ b/vlogger.8
@@ -128,8 +128,12 @@ deprecated synonym for
 .It /etc/vlogger
 An optional executable file that is used to to handle the messages.
 It is executed with
-.Ar tag
-as first argument and replaces the
+.Ar tag ,
+.Ar level
+and
+.Ar facility
+as arguments
+and replaces the
 .Nm
 process.
 .El
diff --git a/vlogger.c b/vlogger.c
index 0393bc8..e3a548e 100644
--- a/vlogger.c
+++ b/vlogger.c
@@ -112,7 +112,17 @@ usage:
 		}
 
 	if (!Sflag && access("/etc/vlogger", X_OK) != -1) {
-		execl("/etc/vlogger", argv0, tag, (char *)0);
+		CODE *cp;
+		const char *sfacility, *slevel;
+		for (cp = prioritynames; cp->c_name; cp++) {
+			if (cp->c_val == level)
+				slevel = cp->c_name;
+		}
+		for (cp = facilitynames; cp->c_name; cp++) {
+			if (cp->c_val == facility)
+				sfacility = cp->c_name;
+		}
+		execl("/etc/vlogger", argv0, tag, slevel, sfacility, (char *)0);
 		fprintf(stderr, "vlogger: exec: %s\n", strerror(errno));
 		exit(1);
 	}