0N/A/*
2362N/A * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage java.util.logging;
0N/A
178N/A
0N/A/**
3887N/A * The management interface for the logging facility. It is recommended
3887N/A * to use the {@link java.lang.management.PlatformLoggingMXBean} management
3887N/A * interface that implements all attributes defined in this
3887N/A * {@code LoggingMXBean}. The
3887N/A * {@link java.lang.management.ManagementFactory#getPlatformMXBean(Class)
3887N/A * ManagementFactory.getPlatformMXBean} method can be used to obtain
3887N/A * the {@code PlatformLoggingMXBean} object representing the management
3887N/A * interface for logging.
0N/A *
0N/A * <p>There is a single global instance of the <tt>LoggingMXBean</tt>.
3887N/A * This instance is an {@link javax.management.MXBean MXBean} that
3887N/A * can be obtained by calling the {@link LogManager#getLoggingMXBean}
3887N/A * method or from the
1806N/A * {@linkplain java.lang.management.ManagementFactory#getPlatformMBeanServer
1806N/A * platform <tt>MBeanServer</tt>}.
3887N/A * <p>
3887N/A * The {@link javax.management.ObjectName ObjectName} that uniquely identifies
3887N/A * the management interface for logging within the {@code MBeanServer} is:
3887N/A * <pre>
3887N/A * {@link LogManager#LOGGING_MXBEAN_NAME java.util.logging:type=Logging}
3887N/A * </pre>
3887N/A * <p>
3887N/A * The instance registered in the platform {@code MBeanServer}
3887N/A * is also a {@link java.lang.management.PlatformLoggingMXBean}.
0N/A *
0N/A * @author Ron Mann
0N/A * @author Mandy Chung
0N/A * @since 1.5
0N/A *
3887N/A * @see java.lang.management.PlatformLoggingMXBean
0N/A */
1806N/Apublic interface LoggingMXBean {
0N/A
0N/A /**
3887N/A * Returns the list of currently registered logger names. This method
0N/A * calls {@link LogManager#getLoggerNames} and returns a list
0N/A * of the logger names.
0N/A *
0N/A * @return A list of <tt>String</tt> each of which is a
0N/A * currently registered <tt>Logger</tt> name.
0N/A */
0N/A public java.util.List<String> getLoggerNames();
0N/A
0N/A /**
0N/A * Gets the name of the log level associated with the specified logger.
0N/A * If the specified logger does not exist, <tt>null</tt>
0N/A * is returned.
0N/A * This method first finds the logger of the given name and
0N/A * then returns the name of the log level by calling:
0N/A * <blockquote>
0N/A * {@link Logger#getLevel Logger.getLevel()}.{@link Level#getName getName()};
0N/A * </blockquote>
0N/A *
0N/A * <p>
0N/A * If the <tt>Level</tt> of the specified logger is <tt>null</tt>,
0N/A * which means that this logger's effective level is inherited
0N/A * from its parent, an empty string will be returned.
0N/A *
0N/A * @param loggerName The name of the <tt>Logger</tt> to be retrieved.
0N/A *
0N/A * @return The name of the log level of the specified logger; or
0N/A * an empty string if the log level of the specified logger
0N/A * is <tt>null</tt>. If the specified logger does not
0N/A * exist, <tt>null</tt> is returned.
0N/A *
0N/A * @see Logger#getLevel
0N/A */
3887N/A public String getLoggerLevel(String loggerName);
0N/A
0N/A /**
0N/A * Sets the specified logger to the specified new level.
0N/A * If the <tt>levelName</tt> is not <tt>null</tt>, the level
0N/A * of the specified logger is set to the parsed <tt>Level</tt>
0N/A * matching the <tt>levelName</tt>.
0N/A * If the <tt>levelName</tt> is <tt>null</tt>, the level
0N/A * of the specified logger is set to <tt>null</tt> and
0N/A * the effective level of the logger is inherited from
0N/A * its nearest ancestor with a specific (non-null) level value.
0N/A *
0N/A * @param loggerName The name of the <tt>Logger</tt> to be set.
0N/A * Must be non-null.
1664N/A * @param levelName The name of the level to set on the specified logger,
1664N/A * or <tt>null</tt> if setting the level to inherit
0N/A * from its nearest ancestor.
0N/A *
0N/A * @throws IllegalArgumentException if the specified logger
0N/A * does not exist, or <tt>levelName</tt> is not a valid level name.
0N/A *
0N/A * @throws SecurityException if a security manager exists and if
0N/A * the caller does not have LoggingPermission("control").
0N/A *
0N/A * @see Logger#setLevel
0N/A */
3887N/A public void setLoggerLevel(String loggerName, String levelName);
0N/A
0N/A /**
0N/A * Returns the name of the parent for the specified logger.
0N/A * If the specified logger does not exist, <tt>null</tt> is returned.
0N/A * If the specified logger is the root <tt>Logger</tt> in the namespace,
0N/A * the result will be an empty string.
0N/A *
0N/A * @param loggerName The name of a <tt>Logger</tt>.
0N/A *
0N/A * @return the name of the nearest existing parent logger;
0N/A * an empty string if the specified logger is the root logger.
0N/A * If the specified logger does not exist, <tt>null</tt>
0N/A * is returned.
0N/A */
0N/A public String getParentLoggerName(String loggerName);
0N/A}