|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.yajul.log.JuliToLog4JService
public class JuliToLog4JService
JMX MBean that plugs in the JULI->Log4j handler on start and unplugs it on stop. Here is an example of a JBoss JMX MBean declaration:
<!-- Redirect java.util.logging to Log4J. --> <mbean code="org.yajul.log.JuliToLog4JService" name="org.yajul:service=JuliToLog4J"> <attribute name="HandlerLevel">DEBUG</attribute> <depends>jboss.system:type=Log4jService,service=Logging</depends> </mbean>Note that because of a small glitch in the JMX specification, the attribute name is 'HandlerLevel', and not 'handlerLevel' as you might expect. See http://madplanet.com/jboss-docu-wiki/Wiki.jsp?page=40.JMX.MBean
Constructor Summary | |
---|---|
JuliToLog4JService()
|
Method Summary | |
---|---|
java.lang.String |
getHandlerLevel()
|
void |
setHandlerLevel(java.lang.String level)
Sets the logging level of the java.util.logging->Log4J 'Handler' to the specified value. |
void |
start()
Called when an MBean is started |
void |
stop()
Called when an MBean is stopped |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JuliToLog4JService()
Method Detail |
---|
public void start() throws java.lang.Exception
Lifecycle
start
in interface Lifecycle
java.lang.Exception
- if something went wrong.public void stop()
Lifecycle
stop
in interface Lifecycle
public java.lang.String getHandlerLevel()
getHandlerLevel
in interface JuliToLog4JServiceMBean
public void setHandlerLevel(java.lang.String level)
JuliToLog4JServiceMBean
setHandlerLevel
in interface JuliToLog4JServiceMBean
level
- the logging level for the adapter, e.g. "INFO"
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |