]> granicus.if.org Git - icinga2/commitdiff
Make Icinga exit on invalid log-severity argument
authorJean Flach <jean-marcel.flach@netways.de>
Thu, 15 Jan 2015 10:45:12 +0000 (11:45 +0100)
committerJean Flach <jean-marcel.flach@netways.de>
Thu, 15 Jan 2015 10:45:12 +0000 (11:45 +0100)
fixes #8226

icinga-app/icinga.cpp

index 9897996f4e2edee258a86fa46f76081fc4024f90..d7d3a8608a811f41111368a281cbde3290c32e8e 100644 (file)
@@ -255,8 +255,9 @@ int Main(void)
                        try {
                                logLevel = Logger::StringToSeverity(severity);
                        } catch (std::exception&) {
-                               /* use the default */
-                               Log(LogWarning, "icinga", "Invalid log level set. Using default 'information'.");
+                               /* Inform user and exit */
+                               Log(LogCritical, "icinga", "Invalid log level set. Default is 'information'.");
+                               return EXIT_FAILURE;
                        }
 
                        Logger::SetConsoleLogSeverity(logLevel);