From fe8ebda11e5f73a21f0a344740ad760ed9efc8f5 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Mon, 17 Oct 2016 13:59:59 +0300 Subject: [PATCH] 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. --- server/core/gateway.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/server/core/gateway.c b/server/core/gateway.c index 107e68635..67eb2e9a9 100644 --- a/server/core/gateway.c +++ b/server/core/gateway.c @@ -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());