logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpo...@apache.org
Subject svn commit: r1481488 - in /logging/log4j/log4j2/trunk: core/src/main/java/org/apache/logging/log4j/core/jmx/ src/site/xdoc/manual/
Date Sun, 12 May 2013 08:33:57 GMT
Author: rpopma
Date: Sun May 12 08:33:56 2013
New Revision: 1481488

URL: http://svn.apache.org/r1481488
Log:
improved JMX documentation

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/AppenderAdminMBean.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/ContextSelectorAdminMBean.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerConfigAdminMBean.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerContextAdminMBean.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/StatusLoggerAdminMBean.java
    logging/log4j/log4j2/trunk/src/site/xdoc/manual/jmx.xml

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/AppenderAdminMBean.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/AppenderAdminMBean.java?rev=1481488&r1=1481487&r2=1481488&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/AppenderAdminMBean.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/AppenderAdminMBean.java
Sun May 12 08:33:56 2013
@@ -16,11 +16,36 @@
  */
 package org.apache.logging.log4j.core.jmx;
 
+
 /**
  * The MBean interface for monitoring and managing an {@code Appender}.
  */
 public interface AppenderAdminMBean {
-    /** ObjectName pattern for AppenderAdmin MBeans. */
+    /**
+     * ObjectName pattern ({@value}) for AppenderAdmin MBeans.
+     * This pattern contains two variables, where the first is the
+     * name of the context, the second is the name of the instrumented appender.
+     * <p>
+     * You can find all registered AppenderAdmin MBeans like this:
+     * </p>
+     * <pre>
+     * MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
+     * String pattern = String.format(AppenderAdminMBean.PATTERN, &quot;*&quot;,
&quot;*&quot;);
+     * Set&lt;ObjectName&gt; appenderNames = mbs.queryNames(new ObjectName(pattern),
null);
+     * </pre>
+     * <p>
+     * Some characters are not allowed in ObjectNames. The logger context name
+     * and appender name may be quoted. When AppenderAdmin MBeans are
+     * registered, their ObjectNames are created using this pattern as follows:
+     * </p>
+     * <pre>
+     * String ctxName = Server.escape(loggerContext.getName());
+     * String appenderName = Server.escape(appender.getName());
+     * String name = String.format(PATTERN, ctxName, appenderName);
+     * ObjectName objectName = new ObjectName(name);
+     * </pre>
+     * @see Server#escape(String)
+     */
     String PATTERN = "org.apache.logging.log4j2:type=LoggerContext,ctx=%s,sub=Appender,name=%s";
 
     /**

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/ContextSelectorAdminMBean.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/ContextSelectorAdminMBean.java?rev=1481488&r1=1481487&r2=1481488&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/ContextSelectorAdminMBean.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/ContextSelectorAdminMBean.java
Sun May 12 08:33:56 2013
@@ -20,7 +20,9 @@ package org.apache.logging.log4j.core.jm
  * The MBean interface for monitoring and managing the {@code ContextSelector}.
  */
 public interface ContextSelectorAdminMBean {
-    /** Object name of this MBean. */
+    /**
+     * ObjectName pattern ({@value}) for the context selector MBean.
+     */
     String NAME = "org.apache.logging.log4j2:type=ContextSelector";
 
     /**

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerConfigAdminMBean.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerConfigAdminMBean.java?rev=1481488&r1=1481487&r2=1481488&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerConfigAdminMBean.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerConfigAdminMBean.java
Sun May 12 08:33:56 2013
@@ -20,7 +20,31 @@ package org.apache.logging.log4j.core.jm
  * The MBean interface for monitoring and managing a {@code LoggerConfig}.
  */
 public interface LoggerConfigAdminMBean {
-    /** ObjectName pattern for LoggerConfigAdmin MBeans. */
+    /**
+     * ObjectName pattern ({@value}) for LoggerConfigAdmin MBeans.
+     * This pattern contains two variables, where the first is the name of the
+     * context, the second is the name of the instrumented logger config.
+     * <p>
+     * You can find all registered LoggerConfigAdmin MBeans like this:
+     * </p>
+     * <pre>
+     * MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
+     * String pattern = String.format(LoggerConfigAdminMBean.PATTERN, &quot;*&quot;,
&quot;*&quot;);
+     * Set&lt;ObjectName&gt; loggerConfigNames = mbs.queryNames(new ObjectName(pattern),
null);
+     * </pre>
+     * <p>
+     * Some characters are not allowed in ObjectNames. The logger context name
+     * and logger config name may be quoted. When LoggerConfigAdmin MBeans are
+     * registered, their ObjectNames are created using this pattern as follows:
+     * </p>
+     * <pre>
+     * String ctxName = Server.escape(loggerContext.getName());
+     * String loggerConfigName = Server.escape(loggerConfig.getName());
+     * String name = String.format(PATTERN, ctxName, loggerConfigName);
+     * ObjectName objectName = new ObjectName(name);
+     * </pre>
+     * @see Server#escape(String)
+     */
     String PATTERN = "org.apache.logging.log4j2:type=LoggerContext,ctx=%s,sub=LoggerConfig,name=%s";
 
     /**

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerContextAdminMBean.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerContextAdminMBean.java?rev=1481488&r1=1481487&r2=1481488&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerContextAdminMBean.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerContextAdminMBean.java
Sun May 12 08:33:56 2013
@@ -24,13 +24,35 @@ import java.util.Map;
  * The MBean interface for monitoring and managing a {@code LoggerContext}.
  */
 public interface LoggerContextAdminMBean {
-    /** ObjectName pattern for LoggerContextAdmin MBeans. */
+    /**
+     * ObjectName pattern ({@value}) for LoggerContextAdmin MBeans.
+     * This pattern contains a variable, which is the name of the logger context.
+     * <p>
+     * You can find all registered LoggerContextAdmin MBeans like this:
+     * </p>
+     * <pre>
+     * MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
+     * String pattern = String.format(LoggerContextAdminMBean.PATTERN, &quot;*&quot;);
+     * Set&lt;ObjectName&gt; loggerContextNames = mbs.queryNames(new ObjectName(pattern),
null);
+     * </pre>
+     * <p>
+     * Some characters are not allowed in ObjectNames. The logger context name
+     * may be quoted. When LoggerContextAdmin MBeans are
+     * registered, their ObjectNames are created using this pattern as follows:
+     * </p>
+     * <pre>
+     * String ctxName = Server.escape(loggerContext.getName());
+     * String name = String.format(PATTERN, ctxName);
+     * ObjectName objectName = new ObjectName(name);
+     * </pre>
+     * @see Server#escape(String)
+     */
     String PATTERN = "org.apache.logging.log4j2:type=LoggerContext,ctx=%s";
 
     /**
      * Notification that the {@code Configuration} of the instrumented
      * {@code LoggerContext} has been reconfigured. Notifications of this type
-     * do not carry a message or user data.
+     * ({@value}) do not carry a message or user data.
      */
     String NOTIF_TYPE_RECONFIGURED = "com.apache.logging.log4j.core.jmx.config.reconfigured";
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/StatusLoggerAdminMBean.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/StatusLoggerAdminMBean.java?rev=1481488&r1=1481487&r2=1481488&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/StatusLoggerAdminMBean.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/StatusLoggerAdminMBean.java
Sun May 12 08:33:56 2013
@@ -24,7 +24,7 @@ import org.apache.logging.log4j.status.S
  * The MBean interface for monitoring and managing the {@code StatusLogger}.
  */
 public interface StatusLoggerAdminMBean {
-    /** Object name of this MBean. */
+    /** Object name ({@value}) of this MBean. */
     String NAME = "org.apache.logging.log4j2:type=StatusLogger";
 
     /**

Modified: logging/log4j/log4j2/trunk/src/site/xdoc/manual/jmx.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/site/xdoc/manual/jmx.xml?rev=1481488&r1=1481487&r2=1481488&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/site/xdoc/manual/jmx.xml (original)
+++ logging/log4j/log4j2/trunk/src/site/xdoc/manual/jmx.xml Sun May 12 08:33:56 2013
@@ -70,6 +70,10 @@
       </section>
 		<a name="Log4J_MBeans" />
       <section name="Log4J Instrumented Components">
+      <p>The best way to find out which methods and attributes of the various
+      Log4J components are accessible via JMX is to look at the
+      <a href="../log4j-core/apidocs/org/apache/logging/log4j/core/jmx/package-summary.html"
+      >Javadoc</a> or by exploring directly in JConsole.</p>
       <p>The screenshot below shows the Log4J MBeans in JConsole.</p>
       <p><img src="../images/jmx-jconsole-mbeans.png" /></p>
       </section>



Mime
View raw message