logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <c...@qos.ch>
Subject Re: JMX support in 1.2beta3
Date Thu, 21 Feb 2002 05:33:46 GMT
Charlie,

The following is messy, but just to give you an idea of the flavor of
the beast.

1) Put /java/jmx/lib/jmxri.jar
     /java/jmx/lib/jmxtools.jar
     /jakarta-log4j-1.2beta3/src/java
     /jakarta-log4j-1.2beta3/dist/classes

into your classpath, changing directory names according to your
environment.

2) cd /jakarta-log4j-1.2beta3/src/java/org/apache/log4j/jmx

3) javac T.java

Do not skip step 3 even if the file T.class is already in the distrib.

4) java T

You'll see output similar to
0 INFO [main] org.apache.log4j.jmx.Agent - Registering HtmlAdaptorServer 
instance.
0 INFO [main] org.apache.log4j.jmx.Agent - Registering 
HierarchyDynamicMBean instance.
10 DEBUG [main] org.apache.log4j.jmx.HierarchyDynamicMBean - preRegister 
called. Server=com.sun.management.jmx.MBeanServerImpl@67e
89, name=log4j:hiearchy=default
10 DEBUG [main] org.apache.log4j.jmx.HierarchyDynamicMBean - postRegister 
is called.
20 DEBUG [main] root - preRegister called. 
Server=com.sun.management.jmx.MBeanServerImpl@67e89, name=log4j:logger=root
20 DEBUG [main] org.apache.log4j.jmx.LoggerDynamicMBean - Adding 
AppenderMBean for appender named console
40 DEBUG [main] org.apache.log4j.jmx.AppenderDynamicMBean - preRegister 
called. Server=com.sun.management.jmx.MBeanServerImpl@67e8
9, name=log4j:appender=console
40 DEBUG [main] org.apache.log4j.jmx.AppenderDynamicMBean - Adding 
LayoutMBean:console,layout=org.apache.log4j.PatternLayout
50 DEBUG [main] org.apache.log4j.jmx.LayoutDynamicMBean - preRegister 
called. Server=com.sun.management.jmx.MBeanServerImpl@67e89,
  name=log4j:appender=console,layout=org.apache.log4j.PatternLayout
50 DEBUG [main] org.apache.log4j.jmx.LayoutDynamicMBean - getMBeanInfo called.
50 DEBUG [main] org.apache.log4j.jmx.AppenderDynamicMBean - getMBeanInfo 
called.
50 DEBUG [main] org.apache.log4j.jmx.HierarchyDynamicMBean - ---Adding 
logger [root] as listener.


5) View http://localhost:8082/ with your browser. Do not stop or kill "java T".

6) Play around. You can add new appenders to categories, view and configure 
appenders, add layouts...

JMX support is not production quality but the ideas are there. The existing 
code needs polishing...
Any volunteers? Regards, Ceki

At 16:57 20.02.2002 -0800, Charlie Cano wrote:

>I have to say that the idea of JMX support for the logging service of 
>Log4J is very exciting - is there any current documentation about what the 
>general layout of MBeans are and how they should be used to 
>configure/access the log4j system?  I'm poking around the 1.2 API docs, 
>but it's a little tricky to figure out the intention of each MBean in 
>terms of controlling the log4j backend...
>
>Thanks,
>Charlie


--
To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>


Mime
View raw message