Skip to content

Commit

Permalink
Add support for redirecting output to a file using logit, issue #21
Browse files Browse the repository at this point in the history
Signed-off-by: Joachim Nilsson <[email protected]>
  • Loading branch information
troglobit committed Jan 15, 2018
1 parent cbd4cc8 commit f253900
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/service.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,17 @@ static int service_start(svc_t *svc)
/* Reset signals */
sig_unblock();

if (svc->log.file[0] == '/') {
execlp("logit", "logit", "-f", svc->log.file, NULL);
_exit(0);
}

if (svc->log.ident[0])
tag = svc->log.ident;
if (svc->log.prio[0])
prio = svc->log.prio;

execlp("logger", "logger", "-t", tag, "-p", prio, NULL);
execlp("logit", "logit", "-t", tag, "-p", prio, NULL);
_exit(0);
}

Expand Down

0 comments on commit f253900

Please sign in to comment.