summaryrefslogtreecommitdiff
path: root/src/log.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-04-03 19:25:29 +0200
committerLennart Poettering <lennart@poettering.net>2012-04-03 19:26:02 +0200
commit3eff4208ffecedd778fec260f0d4b18e94dab443 (patch)
treeafe8f61c676da3d0ec26cf877f76d114683ba361 /src/log.c
parent3338b9595b69a4a6de43bbd0f49b941eba7f6b0e (diff)
logind: log with AUTH facility
Diffstat (limited to 'src/log.c')
-rw-r--r--src/log.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/log.c b/src/log.c
index 5b1721184e..9fffc1dbc0 100644
--- a/src/log.c
+++ b/src/log.c
@@ -37,6 +37,7 @@
static LogTarget log_target = LOG_TARGET_CONSOLE;
static int log_max_level = LOG_INFO;
+static int log_facility = LOG_DAEMON;
static int console_fd = STDERR_FILENO;
static int syslog_fd = -1;
@@ -310,6 +311,10 @@ void log_set_max_level(int level) {
log_max_level = level;
}
+void log_set_facility(int facility) {
+ log_facility = facility;
+}
+
static int write_to_console(
int level,
const char*file,
@@ -457,11 +462,13 @@ static int write_to_journal(
snprintf(header, sizeof(header),
"PRIORITY=%i\n"
+ "SYSLOG_FACILITY=%i\n"
"CODE_FILE=%s\n"
"CODE_LINE=%i\n"
"CODE_FUNCTION=%s\n"
"MESSAGE=",
LOG_PRI(level),
+ LOG_FAC(level),
file,
line,
func);
@@ -497,7 +504,7 @@ static int log_dispatch(
/* Patch in LOG_DAEMON facility if necessary */
if ((level & LOG_FACMASK) == 0)
- level = LOG_DAEMON | LOG_PRI(level);
+ level = log_facility | LOG_PRI(level);
do {
char *e;