about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDuncan Overbruck <mail@duncano.de>2019-08-25 13:07:10 +0200
committerDuncan Overbruck <mail@duncano.de>2019-08-25 14:21:18 +0200
commit0f39e1f97ada46752ed07c1e1033fe4e062c8da9 (patch)
tree1d9bb77c9aeaeeb428b54e964483e2b2c725eb41
parent0566391df8c9c93f75ad99d94c8a19abe379908b (diff)
downloadrunit-void-0f39e1f97ada46752ed07c1e1033fe4e062c8da9.tar.gz
runit-void-0f39e1f97ada46752ed07c1e1033fe4e062c8da9.tar.xz
runit-void-0f39e1f97ada46752ed07c1e1033fe4e062c8da9.zip
vlogger: use the same defaults as logger(1)
-rw-r--r--vlogger.85
-rw-r--r--vlogger.c8
2 files changed, 8 insertions, 5 deletions
diff --git a/vlogger.8 b/vlogger.8
index d2e88ff..d958ae7 100644
--- a/vlogger.8
+++ b/vlogger.8
@@ -66,7 +66,7 @@ See
 or
 .Xr syslog 3 .
 The default is
-.Pa daemon.info .
+.Dq user.notice .
 .It Fl S
 Force
 .Nm
@@ -87,6 +87,9 @@ Defines the
 .Pa ident
 which is used as prefix for each log message or passed as first argument to
 .Pa /etc/vlogger .
+The default is the
+.Ev LOGNAME
+environment variable.
 .It Ar message
 Write the
 .Ar message
diff --git a/vlogger.c b/vlogger.c
index 949fb5b..cba5183 100644
--- a/vlogger.c
+++ b/vlogger.c
@@ -78,12 +78,12 @@ main(int argc, char *argv[])
 {
 	char buf[1024];
 	char *p, *argv0;
-	char *tag = "vlogger";
+	char *tag = NULL;
 	int c;
 	int Sflag = 0;
 	int logflags = 0;
-	int facility = LOG_DAEMON;
-	int level = LOG_INFO;
+	int facility = LOG_USER;
+	int level = LOG_NOTICE;
 
 	argv0 = *argv;
 
@@ -135,7 +135,7 @@ main(int argc, char *argv[])
 		exit(1);
 	}
 
-	openlog(tag, logflags, facility);
+	openlog(tag ? tag : getlogin(), logflags, facility);
 
 	if (argc > 0) {
 		size_t len;