MXS-828: Log warning if both syslog and maxlog disabled

A warning is logged to stderr if both syslog and maxlog are
disabled. Earlier a note was unconditionally written to stdout
for each.
This commit is contained in:
Johan Wikman 2016-10-17 13:59:59 +03:00
parent 15de0a0fb3
commit fe8ebda11e

View File

@ -1750,16 +1750,6 @@ int main(int argc, char **argv)
goto return_main;
}
if (!(*syslog_enabled))
{
printf("Syslog logging is disabled.\n");
}
if (!(*maxlog_enabled))
{
printf("MaxScale logging is disabled.\n");
}
mxs_log_set_syslog_enabled(*syslog_enabled);
mxs_log_set_maxlog_enabled(*maxlog_enabled);
@ -1826,6 +1816,11 @@ int main(int argc, char **argv)
get_cachedir());
}
if (!(*syslog_enabled) && !(*maxlog_enabled))
{
fprintf(stderr, "warning: Both MaxScale and Syslog logging disabled.\n");
}
MXS_NOTICE("Configuration file: %s", cnf_file_path);
MXS_NOTICE("Log directory: %s", get_logdir());
MXS_NOTICE("Data directory: %s", get_datadir());