--- /dev/null 2015-10-09 21:42:05.000000000 +0200 +++ new/jdk/src/java.base/share/classes/sun/util/logger/package-info.java 2015-10-09 21:42:05.000000000 +0200 @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * [JDK INTERNAL] + * The {@code sun.util.logger} package defines an internal provider + * whose default naive implementation is replaced by the {@code java.logging} + * module when the {@code java.logging} module is present. + *

+ * Default Implementation + *

+ * The JDK default implementation of the System.LoggerFinder will attempt to + * load an installed instance of the {@link sun.util.logger.JdkLoggerProvider} + * defined in this package. + * When the {@code java.util.logging} package is present, this will usually + * resolve to an instance of {@link sun.util.logging.internal.JdkLoggingProvider} - + * which provides an implementation of the Logger whose backend is a + * {@link java.util.logging.Logger java.util.logging.Logger}. + * Configuration can thus be performed by direct access to the regular + * {@code java.util.logging} APIs, + * using {@link java.util.logging.Logger java.util.logging.Logger} and + * {@link java.util.logging.LogManager} to access and configure the backend + * Loggers. + *
+ * If however {@code java.util.logging} is not linked with the application, then + * the default implementation will return a simple logger that will print out + * all log messages of INFO level and above to the console ({@code System.err}), + * as implemented by the base {@link sun.util.logger.JdkLoggerProvider} class. + *

+ * Message Levels and Mapping to java.util.logging + *

+ * The {@link java.lang.System.LoggerFinder} class documentation describe how + * {@linkplain java.lang.System.Logger.Level System.Logger levels} are mapped + * to {@linkplain java.util.logging.Level JUL levels} when {@code + * java.util.logging} is the backend. + *

+ * Migrating From {@code java.util.logging} + *

+ * When migrating a class from logging through {@code java.util.logging} to + * logging through the {@link java.lang.System.Logger System Loggers}, there are two + * choices: + *

    + *
  1. You can use the {@link sun.util.logging.PlatformLogger} which will + * forward log events through a logger obtained from the LoggerFinder - but + * this will bind you to an internal API, and the PlatformLogger only support + * a small subset of the methods defined on {@code java.util.logging.Logger}. + *
  2. + *
  3. The other possibility is to obtain a {@link java.lang.System.Logger + * System.Logger} instance from the factory methods defined in + * {@link java.lang.System java.lang.System}, and modify + * all the log statements in the class. This requires more work, but will make + * the class use a public and supported interface, as well as making it + * independent from {@code java.util.logging}, even when + * {@code java.util.logging} is the backend. + *
  4. + *
+ * + * @see sun.util.logger.JdkLoggerProvider + * @see sun.util.logging.internal.JdkLoggingProvider + * @see java.lang.System.LoggerFinder + * @see java.lang.System.Logger + * @see sun.util.logging.PlatformLoggerBridge + * @see sun.util.logging.internal + * + * @since 1.9 + */ +package sun.util.logger;