--- old/src/java.logging/share/classes/java/util/logging/LogManager.java 2018-01-18 15:09:05.000000000 +0000 +++ new/src/java.logging/share/classes/java/util/logging/LogManager.java 2018-01-18 15:09:05.000000000 +0000 @@ -398,9 +398,7 @@ // For backward compatibility: add any handlers configured using // ".handlers" - owner.createLoggerHandlers("", ".handlers") - .stream() - .forEach(root::addHandler); + addInitialRootLoggerHandlers(); // Initialize level if not yet initialized if (!root.isLevelInitialized()) { @@ -995,7 +993,24 @@ } } - private List createLoggerHandlers(final String name, final String handlersPropertyName) + /** + * Invoked when the root logger is initialized. + * This method is called only once, when the root logger is initialized. + * The default implementation of this method will instantiate + * any handlers defined by the {@code ".handlers"} property and add + * them to the root logger. + *

+ * Subclasses of {@code LogManager} may override this method + * to turn off this behavior, by providing an empty method body. + */ + protected void addInitialRootLoggerHandlers() { + createLoggerHandlers("", ".handlers") + .stream() + .forEach(rootLogger::addHandler); + } + + private List createLoggerHandlers(final String name, + final String handlersPropertyName) { String names[] = parseClassNames(handlersPropertyName); List handlers = new ArrayList<>(names.length);