Issue #4830 - Add JMX to new Jetty 10 jetty-slf4j-impl.

Updates after review, take 2.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
Simone Bordet 2020-05-08 22:16:24 +02:00
parent d6d994db5c
commit 41f6e3df51
1 changed files with 4 additions and 5 deletions

View File

@ -23,11 +23,10 @@ import java.io.InputStream;
import java.net.URL;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Arrays;
import java.util.Locale;
import java.util.Properties;
import java.util.TimeZone;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* JettyLogger specific configuration:
@ -137,15 +136,15 @@ public class JettyLoggerConfiguration
return level != null ? level : DEFAULT_LEVEL;
}
protected static JettyLevel toJettyLevel(String loggerName, String levelStr)
static JettyLevel toJettyLevel(String loggerName, String levelStr)
{
if (levelStr == null)
return null;
JettyLevel level = JettyLevel.strToLevel(levelStr);
if (level == null)
{
System.err.printf("Unknown JettyLogger/Slf4J Level [%s]=[%s], expecting only [%s] as values.",
loggerName, levelStr, Stream.of(JettyLevel.values()).map(JettyLevel::name).collect(Collectors.joining(", ")));
System.err.printf("Unknown JettyLogger/SLF4J Level [%s]=[%s], expecting only %s as values.%n",
loggerName, levelStr, Arrays.toString(JettyLevel.values()));
}
return level;
}