mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8191033: Regression in logging.properties: specifying .handlers= for root logger (instead of handlers=) no longer works
The behavior observed for Java 8 is restored Reviewed-by: martin, mchung
This commit is contained in:
parent
6534e2ad54
commit
a87551990a
5 changed files with 310 additions and 5 deletions
|
@ -388,15 +388,23 @@ public class LogManager {
|
|||
// create root logger before reading primordial
|
||||
// configuration - to ensure that it will be added
|
||||
// before the global logger, and not after.
|
||||
owner.rootLogger = owner.new RootLogger();
|
||||
final Logger root = owner.rootLogger = owner.new RootLogger();
|
||||
|
||||
// Read configuration.
|
||||
owner.readPrimordialConfiguration();
|
||||
|
||||
// Create and retain Logger for the root of the namespace.
|
||||
owner.addLogger(owner.rootLogger);
|
||||
if (!owner.rootLogger.isLevelInitialized()) {
|
||||
owner.rootLogger.setLevel(defaultLevel);
|
||||
owner.addLogger(root);
|
||||
|
||||
// For backward compatibility: add any handlers configured using
|
||||
// ".handlers"
|
||||
owner.createLoggerHandlers("", ".handlers")
|
||||
.stream()
|
||||
.forEach(root::addHandler);
|
||||
|
||||
// Initialize level if not yet initialized
|
||||
if (!root.isLevelInitialized()) {
|
||||
root.setLevel(defaultLevel);
|
||||
}
|
||||
|
||||
// Adding the global Logger.
|
||||
|
@ -1708,7 +1716,7 @@ public class LogManager {
|
|||
* @param k a property key in the configuration
|
||||
* @param previous the old configuration
|
||||
* @param next the new configuration (modified by this function)
|
||||
* @param remappingFunction the mapping function.
|
||||
* @param mappingFunction the mapping function.
|
||||
*/
|
||||
static void merge(String k, Properties previous, Properties next,
|
||||
BiFunction<String, String, String> mappingFunction) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue