public static ClassLogger get(@Nullable Logger parent, Class<?> klass, @Nullable String instanceKey) {
if(parent == null) {
parent = Logger.getLogger("");
}
ClassLogger logger = find(parent, klass, instanceKey);
if(logger == null) {
logger = new ClassLogger(parent, klass, instanceKey);
// TODO: call addLogger from the constructuor, when it's no longer public
final LogManager logManager = LogManager.getLogManager();
if(logManager.addLogger(logger)) {
// addLogger will set the parent, so we have to set it back again
logger.setParent(parent);
} else {
// Logger was created by another thread
logger = find(parent, klass, instanceKey);
if(logger == null) {
throw new IllegalStateException("Failed to register logger " + getName(klass, instanceKey));
}
}
}
return logger;
}
java类java.util.logging.LogManager的实例源码
ClassLogger.java 文件源码
项目:ProjectAres
阅读 27
收藏 0
点赞 0
评论 0
Log.java 文件源码
项目:incubator-netbeans
阅读 37
收藏 0
点赞 0
评论 0
static void configure(Level lev, String root, NbTestCase current) {
IL il = new IL(false);
String c = "handlers=" + Log.class.getName() + "\n" +
root + ".level=" + lev.intValue() + "\n";
ByteArrayInputStream is = new ByteArrayInputStream(c.getBytes());
try {
LogManager.getLogManager().readConfiguration(is);
} catch (IOException ex) {
// exception
ex.printStackTrace();
}
Log.current = current;
Log.messages.setLength(0);
Log.messages.append("Starting test ");
Log.messages.append(current.getName());
Log.messages.append('\n');
Log.initialMessages = Log.messages.length();
}
LoggingDeadlock.java 文件源码
项目:openjdk-jdk10
阅读 31
收藏 0
点赞 0
评论 0
public static void main(String[] args) throws InterruptedException{
Thread t1 = new Thread(new Runnable() {
public void run() {
randomDelay();
// Trigger Logger.<clinit>
Logger.getAnonymousLogger();
}
});
Thread t2 = new Thread(new Runnable() {
public void run() {
randomDelay();
// Trigger LogManager.<clinit>
LogManager.getLogManager();
}
});
t1.start();
t2.start();
t1.join();
t2.join();
System.out.println("\nTest passed");
}
TopLoggingTest.java 文件源码
项目:incubator-netbeans
阅读 28
收藏 0
点赞 0
评论 0
public void testCanInfluenceBehaviourBySettingALevelPropertyOnParent() throws Exception {
System.setProperty("ha.nu.level", "100");
Reference<?> ref = new WeakReference<Object>(Logger.getLogger("ha.nu.wirta"));
assertGC("ha.nu.wirta should not exist after this line", ref);
LogManager.getLogManager().readConfiguration();
final Logger log = Logger.getLogger("ha.nu.wirta");
log.log(Level.FINER, "Finer level msg");
Pattern p = Pattern.compile("FINER.*Finer level msg");
String disk = readLog(true);
Matcher d = p.matcher(disk);
if (!d.find()) {
fail("msg shall be logged to file: " + disk);
}
}
TopLoggingTest.java 文件源码
项目:incubator-netbeans
阅读 27
收藏 0
点赞 0
评论 0
public void testCanInfluenceBehaviourBySettingALevelPropertyOnExistingParent() throws Exception {
System.setProperty("ha.nu.level", "100");
Logger l = Logger.getLogger("ha.nu.wirta");
LogManager.getLogManager().readConfiguration();
l.log(Level.FINER, "Finer level msg");
Pattern p = Pattern.compile("FINER.*Finer level msg");
String disk = readLog(true);
Matcher d = p.matcher(disk);
if (!d.find()) {
fail("msg shall be logged to file: " + disk);
}
}
TopLoggingOwnConfigClassTest.java 文件源码
项目:incubator-netbeans
阅读 30
收藏 0
点赞 0
评论 0
public Cfg() throws IOException {
ByteArrayOutputStream os = new ByteArrayOutputStream();
OutputStreamWriter w = new OutputStreamWriter(os);
w.write("handlers=java.util.logging.FileHandler\n");
w.write(".level=100\n");
w.write("java.util.logging.FileHandler.pattern=" + log.toString().replace('\\', '/') +"\n");
w.close();
LogManager.getLogManager().readConfiguration(new ByteArrayInputStream(os.toByteArray()));
}
NbErrorManagerTest.java 文件源码
项目:incubator-netbeans
阅读 26
收藏 0
点赞 0
评论 0
public void testLog() throws Exception {
assertFalse(err.isLoggable(ErrorManager.INFORMATIONAL));
err.log("some msg");
String s = readLog();
assertTrue(s.indexOf("some msg") == -1);
assertTrue(err.isLoggable(ErrorManager.WARNING));
err.log(ErrorManager.WARNING, "another msg");
s = readLog();
assertTrue(s.indexOf("another msg") != -1);
ErrorManager err2 = err.getInstance("foo.bar.baz");
assertFalse(err2.isLoggable(ErrorManager.INFORMATIONAL));
err2.log("sub msg #1");
s = readLog();
assertTrue(s.indexOf("sub msg #1") == -1);
System.setProperty("quux.hoho.level", "0");
LogManager.getLogManager().readConfiguration();
err2 = err.getInstance("quux.hoho.yaya");
assertTrue(err2.isLoggable(ErrorManager.INFORMATIONAL));
err2.log("sub msg #2");
s = readLog();
assertTrue(s, s.indexOf("sub msg #2") != -1);
assertTrue(s, s.indexOf("quux.hoho.yaya") != -1);
}
NbErrorManagerTest.java 文件源码
项目:incubator-netbeans
阅读 30
收藏 0
点赞 0
评论 0
private String readLog() throws IOException {
LogManager.getLogManager().readConfiguration();
File log = new File(new File(new File(getWorkDir(), "var"), "log"), "messages.log");
assertTrue("Log file exists: " + log, log.canRead());
FileInputStream is = new FileInputStream(log);
byte[] arr = new byte[(int)log.length()];
int r = is.read(arr);
assertEquals("all read", arr.length, r);
is.close();
new FileOutputStream(log).close(); // truncate
return "---%<--- [start log of " + getName() + "]\n" + new String(arr).replaceFirst("\0+", "") + "\n---%<--- [end log of " + getName() + "]\n";
}
LoggingConfig.java 文件源码
项目:launcher-backend
阅读 40
收藏 0
点赞 0
评论 0
public LoggingConfig() {
try {
// Load a properties file from class path java.util.logging.config.file
final LogManager logManager = LogManager.getLogManager();
URL configURL = getClass().getResource("/logging.properties");
if (configURL != null) {
try (InputStream is = configURL.openStream()) {
logManager.readConfiguration(is);
}
} else {
// Programmatic configuration
System.setProperty("java.util.logging.SimpleFormatter.format",
"%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$-7s [%3$s] %5$s %6$s%n");
final ConsoleHandler consoleHandler = new ConsoleHandler();
consoleHandler.setLevel(Level.FINEST);
consoleHandler.setFormatter(new SimpleFormatter());
final Logger app = Logger.getLogger("app");
app.setLevel(Level.FINEST);
app.addHandler(consoleHandler);
}
} catch (Exception e) {
e.printStackTrace();
}
}
SimpleUpdateConfigWithInputStreamTest.java 文件源码
项目:openjdk-jdk10
阅读 31
收藏 0
点赞 0
评论 0
public void execute(Runnable run) {
System.out.println("Running test case: " + name());
try {
Configure.setUp(this);
Configure.doPrivileged(run, SimplePolicy.allowControl);
} finally {
Configure.doPrivileged(() -> {
try {
setSystemProperty("java.util.logging.config.file", null);
LogManager.getLogManager().readConfiguration();
System.gc();
} catch (Exception x) {
throw new RuntimeException(x);
}
}, SimplePolicy.allowAll);
}
}
TestAppletLoggerContext.java 文件源码
项目:jdk8u-jdk
阅读 29
收藏 0
点赞 0
评论 0
public static void testFive() {
for (int i=0; i<3 ; i++) {
Logger logger1 = LogManager.getLogManager().getLogger(Logger.GLOBAL_LOGGER_NAME);
Logger logger1b = LogManager.getLogManager().getLogger(Logger.GLOBAL_LOGGER_NAME);
assertNotNull(logger1);
assertNotNull(logger1b);
assertEquals(logger1, logger1b);
Bridge.changeContext();
Logger logger2 = LogManager.getLogManager().getLogger(Logger.GLOBAL_LOGGER_NAME);
Logger logger2b = LogManager.getLogManager().getLogger(Logger.GLOBAL_LOGGER_NAME);
assertNotNull(logger2);
assertNotNull(logger2b);
assertEquals(logger2, logger2b);
assertEquals(logger1, logger2);
}
}
Catalina.java 文件源码
项目:tomcat7
阅读 36
收藏 0
点赞 0
评论 0
@Override
public void run() {
try {
if (getServer() != null) {
Catalina.this.stop();
}
} catch (Throwable ex) {
ExceptionUtils.handleThrowable(ex);
log.error(sm.getString("catalina.shutdownHookFail"), ex);
} finally {
// If JULI is used, shut JULI down *after* the server shuts down
// so log messages aren't lost
LogManager logManager = LogManager.getLogManager();
if (logManager instanceof ClassLoaderLogManager) {
((ClassLoaderLogManager) logManager).shutdown();
}
}
}
TestAppletLoggerContext.java 文件源码
项目:openjdk-jdk10
阅读 25
收藏 0
点赞 0
评论 0
public static void testLoadingMain() {
Bridge.desactivate();
Logger bar = new Bridge.CustomLogger("com.foo.Bar");
LogManager.getLogManager().addLogger(bar);
assertNotNull(bar.getParent());
testParent(bar);
testParent(LogManager.getLogManager().getLogger("global"));
testParent(LogManager.getLogManager().getLogger(bar.getName()));
Bridge.changeContext();
Logger foo = new Bridge.CustomLogger("com.foo.Foo");
boolean b = LogManager.getLogManager().addLogger(foo);
assertEquals(Boolean.TRUE, Boolean.valueOf(b));
assertNotNull(foo.getParent());
testParent(foo);
testParent(LogManager.getLogManager().getLogger("global"));
testParent(LogManager.getLogManager().getLogger(foo.getName()));
}
TestConfigurationLock.java 文件源码
项目:openjdk-jdk10
阅读 31
收藏 0
点赞 0
评论 0
@Override
public void run() {
while (goOn) {
try {
if (Math.random() > CONFSYNCTHRESHOLD) {
// calling readConfiguration while holding a lock can
// increase deadlock probability...
synchronized(fakeConfExternalLock()) {
LogManager.getLogManager().readConfiguration();
}
} else {
LogManager.getLogManager().readConfiguration();
}
Logger blah = Logger.getLogger(BLAH);
blah.setLevel(Level.FINEST);
blah.fine(BLAH);
readCount.incrementAndGet();
pause(1);
} catch (Exception x) {
fail(x);
}
}
}
FileHandler.java 文件源码
项目:Open-DM
阅读 32
收藏 0
点赞 0
评论 0
private static String getPattern() {
LogManager manager = LogManager.getLogManager();
String cname = FileHandler.class.getName();
String pattern = manager.getProperty(cname + ".pattern");
if (pattern == null) {
pattern = "%h/java%u.log";
}
return pattern;
}
Catalina.java 文件源码
项目:lazycat
阅读 30
收藏 0
点赞 0
评论 0
@Override
public void run() {
try {
if (getServer() != null) {
Catalina.this.stop();
}
} catch (Throwable ex) {
ExceptionUtils.handleThrowable(ex);
log.error(sm.getString("catalina.shutdownHookFail"), ex);
} finally {
// If JULI is used, shut JULI down *after* the server shuts down
// so log messages aren't lost
LogManager logManager = LogManager.getLogManager();
if (logManager instanceof ClassLoaderLogManager) {
((ClassLoaderLogManager) logManager).shutdown();
}
}
}
TestAppletLoggerContext.java 文件源码
项目:openjdk-jdk10
阅读 27
收藏 0
点赞 0
评论 0
public static void testThree() {
for (int i=0; i<3 ; i++) {
Logger logger1 = LogManager.getLogManager().getLogger("");
Logger logger1b = LogManager.getLogManager().getLogger("");
assertNotNull(logger1);
assertNotNull(logger1b);
assertEquals(logger1, logger1b);
Bridge.changeContext();
Logger logger2 = LogManager.getLogManager().getLogger("");
Logger logger2b = LogManager.getLogManager().getLogger("");
assertNotNull(logger2);
assertNotNull(logger2b);
assertEquals(logger2, logger2b);
assertEquals(logger1, logger2);
}
}
SimpleUpdateConfigurationTest.java 文件源码
项目:openjdk-jdk10
阅读 41
收藏 0
点赞 0
评论 0
public void execute(Runnable run) {
System.out.println("Running test case: " + name());
try {
Configure.setUp(this);
Configure.doPrivileged(run, SimplePolicy.allowControl);
} finally {
Configure.doPrivileged(() -> {
try {
setSystemProperty("java.util.logging.config.file", null);
LogManager.getLogManager().readConfiguration();
System.gc();
} catch (Exception x) {
throw new RuntimeException(x);
}
}, SimplePolicy.allowAll);
}
}
AppSetup.java 文件源码
项目:scorekeeperfrontend
阅读 30
收藏 0
点赞 0
评论 0
/**
* Do some common setup for all applications at startup
* @param name the application name used for Java logging and database logging
*/
public static void appSetup(String name)
{
// Set our platform wide L&F
System.setProperty("swing.defaultlaf", "javax.swing.plaf.nimbus.NimbusLookAndFeel");
UIDefaults defaults = UIManager.getLookAndFeelDefaults();
defaults.put("Table.gridColor", new Color(140,140,140));
defaults.put("Table.showGrid", true);
// Set the program name which is used by PostgresqlDatabase to identify the app in logs
System.setProperty("program.name", name);
// Start with a fresh root set at warning
Logger root = LogManager.getLogManager().getLogger("");
Formatter format = new SingleLineFormatter();
root.setLevel(Level.WARNING);
for(Handler handler : root.getHandlers()) {
root.removeHandler(handler);
}
// Set prefs levels before windows preference load barfs useless data on the user
Logger.getLogger("java.util.prefs").setLevel(Level.SEVERE);
// postgres JDBC spits out a lot of data even though we catch the exception
Logger.getLogger("org.postgresql.jdbc").setLevel(Level.OFF);
Logger.getLogger("org.postgresql.Driver").setLevel(Level.OFF);
// Add console handler if running in debug mode
if (Prefs.isDebug()) {
ConsoleHandler ch = new ConsoleHandler();
ch.setLevel(Level.ALL);
ch.setFormatter(format);
root.addHandler(ch);
}
// For our own logs, we can set super fine level or info depending on if debug mode and attach dialogs to those
Logger applog = Logger.getLogger("org.wwscc");
applog.setLevel(Prefs.isDebug() ? Level.FINEST : Level.INFO);
applog.addHandler(new AlertHandler());
Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {
@Override
public void uncaughtException(Thread t, Throwable e) {
applog.log(Level.WARNING, String.format("\bUncaughtException in %s: %s", t, e), e);
}});
try {
File logdir = Prefs.getLogDirectory().toFile();
if (!logdir.exists())
if (!logdir.mkdirs())
throw new IOException("Can't create log directory " + logdir);
FileHandler fh = new FileHandler(new File(logdir, name+".%g.log").getAbsolutePath(), 1000000, 10, true);
fh.setFormatter(format);
fh.setLevel(Level.ALL);
root.addHandler(fh);
} catch (IOException ioe) {
JOptionPane.showMessageDialog(FocusManager.getCurrentManager().getActiveWindow(),
"Unable to enable logging to file: " + ioe, "Log Error", JOptionPane.ERROR_MESSAGE);
}
// force the initialization of IdGenerator on another thread so app can start now without an odd delay later
new Thread() {
public void run() {
IdGenerator.generateId();
}
}.start();
}
TestAppletLoggerContext.java 文件源码
项目:jdk8u-jdk
阅读 28
收藏 0
点赞 0
评论 0
public static void testLoadingApplet() {
Bridge.changeContext();
Logger bar = new Bridge.CustomLogger("com.foo.Bar");
LogManager.getLogManager().addLogger(bar);
assertNotNull(bar.getParent());
testParent(bar);
testParent(LogManager.getLogManager().getLogger("global"));
testParent(LogManager.getLogManager().getLogger(bar.getName()));
Bridge.desactivate();
Logger foo = new Bridge.CustomLogger("com.foo.Foo");
boolean b = LogManager.getLogManager().addLogger(foo);
assertEquals(Boolean.TRUE, Boolean.valueOf(b));
assertNotNull(foo.getParent());
testParent(foo);
testParent(LogManager.getLogManager().getLogger("global"));
testParent(LogManager.getLogManager().getLogger(foo.getName()));
}
TestConfigurationLock.java 文件源码
项目:openjdk-jdk10
阅读 28
收藏 0
点赞 0
评论 0
@Override
public void run() {
while (goOn) {
try {
if (Math.random() > CONFSYNCTHRESHOLD) {
// calling reset while holding a lock can increase
// deadlock probability...
synchronized(fakeConfExternalLock()) {
LogManager.getLogManager().reset();
}
} else {
LogManager.getLogManager().reset();
}
Logger blah = Logger.getLogger(BLAH);
blah.setLevel(Level.FINEST);
blah.fine(BLAH);
resetCount.incrementAndGet();
pause(1);
} catch (Exception x) {
fail(x);
}
}
}
LoggingProviderImpl.java 文件源码
项目:openjdk-jdk10
阅读 30
收藏 0
点赞 0
评论 0
/**
* Creates a java.util.logging.Logger for the given module.
* @param name the logger name.
* @param module the module for which the logger should be created.
* @return a Logger suitable for use in the given module.
*/
private static java.util.logging.Logger demandJULLoggerFor(final String name,
Module module) {
final LogManager manager = LogManager.getLogManager();
final SecurityManager sm = System.getSecurityManager();
if (sm == null) {
return logManagerAccess.demandLoggerFor(manager, name, module);
} else {
final PrivilegedAction<java.util.logging.Logger> pa =
() -> logManagerAccess.demandLoggerFor(manager, name, module);
return AccessController.doPrivileged(pa, null, LOGGING_CONTROL_PERMISSION);
}
}
JavaUtilLoggingSystem.java 文件源码
项目:Reer
阅读 27
收藏 0
点赞 0
评论 0
private void uninstall(Level level) {
if (!installed) {
return;
}
LogManager.getLogManager().reset();
logger.setLevel(level);
installed = false;
}
GameServer.java 文件源码
项目:L2jBrasil
阅读 31
收藏 0
点赞 0
评论 0
public static void main(String[] args) throws Exception
{
Server.serverMode = Server.MODE_GAMESERVER;
// Local Constants
final String LOG_FOLDER = "log"; // Name of folder for log file
final String LOG_NAME = "./config/other/log.cfg"; // Name of log file
// Create log folder
File logFolder = new File(Config.DATAPACK_ROOT, LOG_FOLDER);
logFolder.mkdir();
// Create input stream for log file -- or store file data into memory
InputStream is = new FileInputStream(new File(LOG_NAME));
LogManager.getLogManager().readConfiguration(is);
is.close();
// Initialize config
Config.load();
Util.printSection("Data Base");
L2DatabaseFactory.getInstance();
gameServer = new GameServer();
if (Config.IS_TELNET_ENABLED)
{
_statusServer = new Status(Server.serverMode);
_statusServer.start();
}
else
System.out.println("Telnet is disabled.");
}
TestLogConfigurationDeadLockWithConf.java 文件源码
项目:jdk8u-jdk
阅读 32
收藏 0
点赞 0
评论 0
@Override
public void run() {
while (goOn) {
try {
LogManager.getLogManager().readConfiguration();
readCount.incrementAndGet();
Thread.sleep(1);
} catch (Exception x) {
fail(x);
}
}
}
SimpleUpdateConfigurationTest.java 文件源码
项目:openjdk-jdk10
阅读 30
收藏 0
点赞 0
评论 0
static void updateConfigurationWith(Properties propertyFile,
Function<String,BiFunction<String,String,String>> remapper) {
try {
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
propertyFile.store(bytes, propertyFile.getProperty("test.name"));
ByteArrayInputStream bais = new ByteArrayInputStream(bytes.toByteArray());
LogManager.getLogManager().updateConfiguration(bais, remapper);
} catch (IOException ex) {
throw new RuntimeException(ex);
}
}
RootLevelInConfigFile.java 文件源码
项目:jdk8u-jdk
阅读 30
收藏 0
点赞 0
评论 0
public static void main(String[] args) throws IOException {
System.setProperty(CONFIG_FILE_KEY,
new File(System.getProperty("test.src", "."),
"rootlogger.properties").getAbsolutePath());
System.out.println(CONFIG_FILE_KEY + "="
+ System.getProperty(CONFIG_FILE_KEY));
if (! new File(System.getProperty(CONFIG_FILE_KEY)).canRead()) {
throw new RuntimeException("can't read config file: "
+ System.getProperty(CONFIG_FILE_KEY));
}
final String configFile = System.getProperty(CONFIG_FILE_KEY);
test("no security");
LogManager.getLogManager().readConfiguration();
Policy.setPolicy(new SimplePolicy(configFile));
System.setSecurityManager(new SecurityManager());
test("security");
LogManager.getLogManager().readConfiguration();
final JavaAWTAccessStub access = new JavaAWTAccessStub();
SharedSecrets.setJavaAWTAccess(access);
test("security and no context");
for (Context ctx : Context.values()) {
LogManager.getLogManager().readConfiguration();
access.setContext(ctx);
test("security and context " + ctx);
}
}
FileHandlerPath.java 文件源码
项目:openjdk-jdk10
阅读 29
收藏 0
点赞 0
评论 0
static void setUp(TestCase test, Properties propertyFile) {
switch (test) {
case SECURE:
if (policy == null && System.getSecurityManager() != null) {
throw new IllegalStateException("SecurityManager already set");
} else if (policy == null) {
policy = new SimplePolicy(TestCase.SECURE, allowAll);
Policy.setPolicy(policy);
System.setSecurityManager(new SecurityManager());
}
if (System.getSecurityManager() == null) {
throw new IllegalStateException("No SecurityManager.");
}
if (policy == null) {
throw new IllegalStateException("policy not configured");
}
break;
case UNSECURE:
if (System.getSecurityManager() != null) {
throw new IllegalStateException("SecurityManager already set");
}
break;
default:
new InternalError("No such testcase: " + test);
}
doPrivileged(() -> {
try {
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
propertyFile.store(bytes, propertyFile.getProperty("test.name"));
ByteArrayInputStream bais = new ByteArrayInputStream(bytes.toByteArray());
LogManager.getLogManager().readConfiguration(bais);
} catch (IOException ex) {
throw new RuntimeException(ex);
}
});
}
HandlersOnComplexUpdate.java 文件源码
项目:openjdk-jdk10
阅读 33
收藏 0
点赞 0
评论 0
static void updateConfigurationWith(Properties propertyFile, boolean append) {
try {
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
propertyFile.store(bytes, propertyFile.getProperty("test.name"));
ByteArrayInputStream bais = new ByteArrayInputStream(bytes.toByteArray());
Function<String, BiFunction<String,String,String>> remapper =
append ? (x) -> ((o, n) -> n == null ? o : n)
: (x) -> ((o, n) -> n);
LogManager.getLogManager().updateConfiguration(bais, remapper);
} catch (IOException ex) {
throw new RuntimeException(ex);
}
}
TestLoggerNames.java 文件源码
项目:openjdk-jdk10
阅读 27
收藏 0
点赞 0
评论 0
static void checkLoggerNames(List<Logger> loggers) {
Enumeration<String> names = LogManager.getLogManager().getLoggerNames();
if (names instanceof Iterator) {
for (Iterator<?> it = Iterator.class.cast(names); it.hasNext(); ) {
try {
it.remove();
throw new RuntimeException("Iterator supports remove!");
} catch (UnsupportedOperationException x) {
System.out.println("OK: Iterator doesn't support remove.");
}
}
// We're not supposed to come here, but if we do then we
// need to rewind names...
names = LogManager.getLogManager().getLoggerNames();
}
List<String> loggerNames = Collections.list(names);
if (!loggerNames.contains("")) {
throw new RuntimeException("\"\"" +
" not found in " + loggerNames);
}
if (!loggerNames.contains("global")) {
throw new RuntimeException("global" +
" not found in " + loggerNames);
}
for (Logger l : loggers) {
if (!loggerNames.contains(l.getName())) {
throw new RuntimeException(l.getName() +
" not found in " + loggerNames);
}
}
System.out.println("Got all expected logger names");
}