AC_DEFINE([SYSTEMD_JOURNAL], 0, [Define to 1 if libsystemd-journald is available])
fi
+AC_ARG_WITH(config-logging-backend-default, AS_HELP_STRING([--with-logging-backend-default=backend], [Default value for logging.backend]), nm_config_logging_backend_default="$withval", nm_config_logging_backend_default="")
+if test "$nm_config_logging_backend_default" != 'debug' \
+ -a "$nm_config_logging_backend_default" != 'syslog' \
+ -a "$nm_config_logging_backend_default" != 'journal' \
+ -a "$nm_config_logging_backend_default" != 'journal-syslog-style'; then
+ # unknown backend. Reset to default. Silently accept the invalid value to
+ # be future proof.
+ nm_config_logging_backend_default=''
+fi
+if test "$nm_config_logging_backend_default" = ""; then
+ if test "$have_systemd_journal" = "yes"; then
+ nm_config_logging_backend_default='journal-syslog-style'
+ else
+ nm_config_logging_backend_default='syslog'
+ fi
+fi
+AC_DEFINE_UNQUOTED(NM_CONFIG_LOGGING_BACKEND_DEFAULT, "$nm_config_logging_backend_default", [Default configuration option for logging.backend])
+NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT="$nm_config_logging_backend_default"
+AC_SUBST(NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT)
+
# Session tracking support
AC_ARG_WITH(systemd-logind, AS_HELP_STRING([--with-systemd-logind=yes|no],
[Support systemd session tracking]))
fi
echo " polkit agent: ${enable_polkit_agent}"
echo " selinux: $have_selinux"
-echo " systemd-journald: $have_systemd_journal"
+echo " systemd-journald: $have_systemd_journal (logging.backend: ${nm_config_logging_backend_default})"
echo " hostname persist: ${hostname_persist}"
echo
fields in the text.
If NetworkManager is started in debug mode (<literal>--debug</literal>)
this option is ignored and "<literal>debug</literal>" is always used.
- Otherwise, the default is "<literal>journal-syslog-style</literal>" if
- NetworkManager was compiled with systemd journal support.
+ Otherwise, the default is "<literal>@NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@</literal>".
</para></listitem>
</varlistentry>
</variablelist>
if (log_backend != LOG_BACKEND_GLIB)
g_return_if_reached ();
- if (g_strcmp0 (logging_backend, "debug") == 0) {
+ if (!logging_backend)
+ logging_backend = ""NM_CONFIG_LOGGING_BACKEND_DEFAULT;
+
+ if (strcmp (logging_backend, "debug") == 0) {
log_backend = LOG_BACKEND_SYSLOG;
openlog (G_LOG_DOMAIN, LOG_CONS | LOG_PERROR | LOG_PID, LOG_USER);
#if SYSTEMD_JOURNAL
- } else if (g_strcmp0 (logging_backend, "syslog") != 0) {
- if (g_strcmp0 (logging_backend, "journal-syslog-style") != 0)
+ } else if (strcmp (logging_backend, "syslog") != 0) {
+ if (strcmp (logging_backend, "journal-syslog-style") != 0)
log_backend = LOG_BACKEND_JOURNAL;
else
log_backend = LOG_BACKEND_JOURNAL_SYSLOG_STYLE;