01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package java.util.logging;
19:
20: import java.util.List;
21:
22: /**
23: * The management interface for the logging sub-system.
24: * <p>
25: * ObjectName =
26: * {@link LogManager#LOGGING_MXBEAN_NAME java.util.logging:type=Logging}
27: * </p>
28: *
29: * @since 1.5
30: */
31: public interface LoggingMXBean {
32:
33: /**
34: * Gets the String value of the logging level of a logger. An empty String
35: * is returned when the logger's level is defined by its parent.
36: *
37: * @param loggerName
38: * The name of the logger lookup.
39: * @return A String if the logger was found, otherwise <code>null</code>.
40: * @see Level#getName()
41: */
42: String getLoggerLevel(String loggerName);
43:
44: /**
45: * Gets a list of all currently registered logger's names. This is performed
46: * using the {@link LogManager#getLoggerNames()}.
47: *
48: * @return A List of String instances.
49: */
50: List<String> getLoggerNames();
51:
52: /**
53: * Gets the name of the parent logger of a logger. If the logger doesn't
54: * exist then <code>null</code> is returned. If the logger is the root
55: * logger, then an empty String is returned.
56: *
57: * @param loggerName
58: * The name of the logger to lookup.
59: * @return A String if the logger was found, otherwise <code>null</code>.
60: */
61: String getParentLoggerName(String loggerName);
62:
63: /**
64: * Sets the log level of a logger.
65: *
66: * @param loggerName
67: * The name of the logger to set the level on, which must not be
68: * <code>null</code>.
69: * @param levelName
70: * The level to set on the logger, which may be <code>null</code>.
71: * @throws IllegalArgumentException
72: * if <code>loggerName</code> is not a registered logger or if
73: * <code>levelName</code> is not null and an invalid value.
74: * @throws SecurityException
75: * if a security manager exists and the caller doesn't have
76: * LoggingPermission("control").
77: * @see Level#parse(String)
78: */
79: void setLoggerLevel(String loggerName, String levelName);
80: }
|