diff --git a/dbms/src/Server/ExtractFromConfig.cpp b/dbms/src/Server/ExtractFromConfig.cpp index bb3607f39f5..db8d7ff1597 100644 --- a/dbms/src/Server/ExtractFromConfig.cpp +++ b/dbms/src/Server/ExtractFromConfig.cpp @@ -6,12 +6,27 @@ #include #include #include +#include #include #include #include +static std::string normalize(const std::string & log_level) +{ + std::string norm = Poco::toLower(log_level); + // normalize + // info -> information + // warn -> warning + if (norm == "info") + return "information"; + else if (norm == "warn") + return "warning"; + else + return norm; +} + static void setupLogging(const std::string & log_level) { Poco::AutoPtr channel(new Poco::ConsoleChannel); @@ -19,7 +34,7 @@ static void setupLogging(const std::string & log_level) formatter->setProperty("pattern", "%L%Y-%m-%d %H:%M:%S.%i <%p> %s: %t"); Poco::AutoPtr formatting_channel(new Poco::FormattingChannel(formatter, channel)); Poco::Logger::root().setChannel(formatting_channel); - Poco::Logger::root().setLevel(log_level); + Poco::Logger::root().setLevel(normalize(log_level)); } static std::string extractFromConfig(