public static LogLevel getLogLevelFromConfigFile(InputStream configFileStream, LogFileSource logSource) throws IOException
{
// For source LogFileSource.JAVA, the level is found in two places: the logger line and the appender line
// For LogFileSource.SMX, there is only the (root) logger line
// So, for simplicity check the logger line in either case
LogLevel logLevel = null;
String level = LoggingUtil.matchGroup(configFileStream, loggerPattern(loggerPrefix(logSource), appenderName(logSource)), 2);
if (LogLevel.isValidLogLevel(level)) {
logLevel = new LogLevel(level);
}
return logLevel;
}