1 /*
2 * EL4J, the Extension Library for the J2EE, adds incremental enhancements to
3 * the spring framework, http://el4j.sf.net
4 * Copyright (C) 2006 by ELCA Informatique SA, Av. de la Harpe 22-24,
5 * 1000 Lausanne, Switzerland, http://www.elca.ch
6 *
7 * EL4J is published under the GNU Lesser General Public License (LGPL)
8 * Version 2.1. See http://www.gnu.org/licenses/
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * For alternative licensing, please contact info@elca.ch
16 */
17 package ch.elca.el4j.services.monitoring.jmx;
18
19 //Checkstyle: UseLogger off
20 import org.apache.log4j.Appender;
21 import org.apache.log4j.Level;
22 //Checkstyle: UseLogger on
23 /**
24 * The interface of the logging proxy class, for setting logging properties via JMX.
25 *
26 * @svnLink $Revision: 4093 $;$Date: 2010-01-15 14:26:34 +0100 (Fr, 15. Jan 2010) $;$Author: jonasha $;$URL: https://el4j.svn.sourceforge.net/svnroot/el4j/branches/el4j_3_1/el4j/framework/modules/jmx/src/main/java/ch/elca/el4j/services/monitoring/jmx/Log4jConfigMBean.java $
27 *
28 * @author Rashid Waraich (RWA)
29 */
30 public interface Log4jConfigMBean {
31
32 /**
33 * Getter method for the name member variable.
34 *
35 * @return Returns the name.
36 */
37 String getName();
38
39 /**
40 * Changes the log level for a category or creates a new category if the
41 * supplied category name doesn't exist.
42 *
43 * @param category
44 * The category of the logger.
45 * @param level
46 * The level of the logger to be set.
47 */
48 public void changeLogLevel(String category, String level);
49
50 /**
51 * Add appender to the specified logger category.
52 *
53 * @param category
54 * The category of the logger.
55 * @param appenderName
56 * The name of the appender to be removed.
57 */
58 public void addAppender(String category, String appenderName);
59
60 /**
61 * Remove appender from the specified logger category.
62 *
63 * @param category
64 * The category of the logger.
65 * @param appenderName
66 * The name of the appender to be removed.
67 */
68 public void removeAppender(String category, String appenderName);
69
70 /**
71 * For all loaded appenders, a String representaion of the appenderName and
72 * appenderObject is returned.
73 *
74 * @return The available appenders.
75 */
76 public String[] getAvailableAppendersList();
77
78 /**
79 * Return the log level of the Logger category.
80 *
81 * @param category
82 * The category.
83 * @return The level.
84 */
85 public Level showLogLevel(String category);
86
87 /**
88 * Return the appenders of the specified Logger category.
89 *
90 * @param category
91 * The category.
92 * @return The appenders.
93 */
94 public Appender[] showAppenders(String category);
95
96 /**
97 * Sets the level of the root logger.
98 *
99 * @param level
100 * The logging level.
101 */
102 public void setRootLoggerLevel(String level);
103
104 /**
105 * Gives back the level of the root logger.
106 *
107 * @return The logging level.
108 */
109 public String getRootLoggerLevel();
110
111 /**
112 * Shows the XML representation of all changes made to any logger level
113 * through the JMX interface.
114 *
115 * @return HTML embeddable XML (suitable for pasting in log4j.xml)
116 */
117 public String showLogLevelCache();
118
119 /**
120 * Get the path of the log4j configuration file, which was loaded
121 * initially (at application start).
122 * @return The path of the configuration file.
123 */
124 public String getInitialConfigurationPath();
125 }