(based on log4j-1.2.13) Current JMX implementation has an hard coded domain name ("log4j") for registering the MBean instances. This is not flexible enough when you need to configure multiple log4j repositories, all in different applications running on a J2EE server. I made some minor changes which extends the current interface and adds the option to specify your own domain name. All comments are welcome.
Created attachment 18716 [details] Extended JMX MBean classes to allow alternate domain name This patch allows you to chose your own domain name. All comments welcome.
Better would be for an MBean to create child MBeans within the same domain. I fixed this for 1.3 (SVN head) and added a test demonstrating it works.
Elias committed changes against log4j/trunk in rev 500491
Previous commit caused Gump failure on unit tests since build.jmx was not a precondition for building the newly added unit test. The newly added unit test is still not run, but rev 502375 at least fixes the build failure. The previous change also resulted in the following compatibility issues with log4j 1.2.8: o.a.l.jmx.HierarchyDynamicMBean Removed org.apache.log4j.spi.HierarchyEventListener from the set of implemented interfaces o.a.l.jmx.HierarchyDynamicMBean.addAppenderEvent Method 'public void addAppenderEvent(org.apache.log4j.Category, org.apache.log4j.Appender)' has been removed o.a.l.jmx.HierarchyDynamicMBean.removeAppenderEvent Method 'public void removeAppenderEvent(org.apache.log4j.Category, org.apache.log4j.Appender)' has been removed Reopening bug until unit tests are integrated into tests/build.xml.
Well except on JDK 1.3 and 1.4 since HierarchyMBeanTest depends on classes introduced in JDK 1.5. Rev 502381 suppresses compilation of that class for now.