< prev index next >

src/java.logging/share/classes/java/util/logging/LogManager.java

Print this page

        

@@ -386,19 +386,27 @@
                         assert initializedCalled && !initializationDone;
 
                         // 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 configure 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.
                         // Do not call Logger.getGlobal() here as this might trigger
                         // subtle inter-dependency issues.

@@ -1706,11 +1714,11 @@
          * from {@code next}.
          *
          * @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) {
             String p = trim(previous.getProperty(k, null));
             String n = trim(next.getProperty(k, null));
< prev index next >