org.apache.logging.log4j.core.jmx
Class Server

java.lang.Object
  extended by org.apache.logging.log4j.core.jmx.Server

public final class Server
extends Object

Creates MBeans to instrument various classes in the log4j class hierarchy.

All instrumentation for Log4J2 classes can be disabled by setting system property -Dlog4j2.disable.jmx=true.


Method Summary
static String escape(String name)
          Either returns the specified name as is, or returns a quoted value containing the specified name with the special characters (comma, equals, colon, quote, asterisk, or question mark) preceded with a backslash.
static void registerMBeans(ContextSelector selector)
          Creates MBeans to instrument the specified selector and other classes in the log4j class hierarchy and registers the MBeans in the platform MBean server so they can be accessed by remote clients.
static void registerMBeans(ContextSelector selector, MBeanServer mbs)
          Creates MBeans to instrument the specified selector and other classes in the log4j class hierarchy and registers the MBeans in the specified MBean server so they can be accessed by remote clients.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

escape

public static String escape(String name)
Either returns the specified name as is, or returns a quoted value containing the specified name with the special characters (comma, equals, colon, quote, asterisk, or question mark) preceded with a backslash.

Parameters:
name - the name to escape so it can be used as a value in an ObjectName.
Returns:
the escaped name

registerMBeans

public static void registerMBeans(ContextSelector selector)
                           throws JMException
Creates MBeans to instrument the specified selector and other classes in the log4j class hierarchy and registers the MBeans in the platform MBean server so they can be accessed by remote clients.

Parameters:
selector - starting point in the log4j class hierarchy
Throws:
JMException - if a problem occurs during registration

registerMBeans

public static void registerMBeans(ContextSelector selector,
                                  MBeanServer mbs)
                           throws JMException
Creates MBeans to instrument the specified selector and other classes in the log4j class hierarchy and registers the MBeans in the specified MBean server so they can be accessed by remote clients.

Parameters:
selector - starting point in the log4j class hierarchy
mbs - the MBean Server to register the instrumented objects in
Throws:
JMException - if a problem occurs during registration


Copyright © 1999-2013 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.