* dbus upstream still refers to dbus.target and shouldn't
-* ensure that logind sets the syslog facility to AUTH when logging
-
* when a service has the same env var set twice we actually store it twice and return that in systemctl show -p... We should only show the last setting
* add man page documenting all kernel cmdline options, including stuff like fsck.mode=
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;
log_max_level = level;
}
+void log_set_facility(int facility) {
+ log_facility = facility;
+}
+
static int write_to_console(
int level,
const char*file,
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);
/* 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;
void log_set_target(LogTarget target);
void log_set_max_level(int level);
+void log_set_facility(int facility);
int log_set_target_from_string(const char *e);
int log_set_max_level_from_string(const char *e);