Skip to content

Commit 06c1ad4

Browse files
committed
vlogger: force to use syslog if message arguments are given
1 parent b25043d commit 06c1ad4

2 files changed

Lines changed: 32 additions & 11 deletions

File tree

vlogger.8

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,35 @@
1212
.Op Fl t Ar tag
1313
.Op Ar message ...
1414
.Sh DESCRIPTION
15-
By default,
15+
The
1616
.Nm
17-
reads lines from
17+
utility writes messages to the system log.
18+
.Pp
19+
With
20+
.Ar message
21+
arguments
22+
.Nm
23+
will always write messages to the system log.
24+
Without
25+
.Ar message
26+
arguments
27+
.Nm
28+
reads messages from
1829
.Dv stdin
19-
and sends them to syslog.
20-
If the file
30+
or the file specified with the
31+
.Fl f
32+
flag.
33+
If the
2134
.Pa /etc/vlogger
22-
exists and is executable it is executed with
23-
.Ar tag
24-
as only argument and replaces
25-
.Nm .
35+
executable exists
36+
.Nm
37+
executes it with
38+
.Ar tag ,
39+
level
40+
and priority as arguments,
41+
replacing the
42+
.Nm
43+
process.
2644
.Pp
2745
If
2846
.Nm
@@ -34,10 +52,10 @@ supervision suite it uses the service name as default
3452
As example if
3553
.Nm
3654
is linked to
37-
.Dv /var/service/foo/log/run
55+
.Pa /var/service/foo/log/run
3856
it uses
39-
.Dv foo
40-
as default
57+
.Dq foo
58+
as
4159
.Ar tag .
4260
.Pp
4361
The options are as follows:

vlogger.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ main(int argc, char *argv[])
119119
argc -= optind;
120120
argv += optind;
121121

122+
if (argc > 0)
123+
Sflag++;
124+
122125
if (!Sflag && access("/etc/vlogger", X_OK) != -1) {
123126
CODE *cp;
124127
const char *sfacility = "", *slevel = "";

0 commit comments

Comments
 (0)