Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0-beta5
    • Component/s: Core, Documentation
    • Labels:
      None

      Description

      Provide built-in support for JMX.

      Features wish-list (from the log4j-dev mailing list):

      1. Show all the LoggerContexts and their configurations.
      2. Ability to modify a configuration (this should involve cloning the current configuration,
      modifying it and then replacing the prior configuration with the new one).
      3. Statistics from various components.
      4. Display log output on the JMX console (at least the StatusLogger output).


      stats : (if using) rolling file - number rolls - long, time of last x
      rolls - sometimes a node starts logging too much and we need to add to
      number of max files or other action (could mean too many errors)
      number of err & fatal logs in last x2 hours

      where x, x2 are jmx properties with good defaults


      For statistics I could imagine things like the total number of events. The number of non-filtered
      events. The number of events that were directed to a specific Appender, and such.


      I could imagine it could be handy to connect via JMX and retrieve the last
      X number of warn/error/fatal events via JMX..


      ability to "flushBuffers"

      1. LOG4J2-207-jmx-images.zip
        973 kB
        Remko Popma
      2. LOG4J2-207-jmx-v2.patch
        103 kB
        Remko Popma

        Issue Links

          Activity

          Hide
          Remko Popma added a comment - - edited

          Please find attached files LOG4J2-207-jmx.patch and LOG4J2-207-jmx-images.zip.
          Images are used in the manual page, please unzip into src/site/resources/images.

          This patch provides initial JMX support with MBeans for
          StatusLogger, ContextSelector, LoggerContext, LoggerConfig and Appender.

          A number of attributes of these objects can be viewed and some can also be modified in JMX tools like JConsole.

          Also included is a simple client GUI that can be used to monitor the StatusLogger output and modify the configuration.
          The client GUI can run stand-alone or as a JConsole plug-in.

          Maven needs to see the jconsole.jar during the build, so I modified core/pom.xml
          and added two profiles because apparently on the mac, jconsole.jar lives in $

          {java.home}/../Classes/jconsole.jar,
          not in ${java.home}

          /../lib/jconsole.jar.
          I don't have a mac so I was unable to test this.
          If this breaks the build, you could consider removing the ClientGUIJConsolePlugin.java file.
          This is the only class that depends on jconsole.jar.

          This is not the final version, for example there are no stats yet.
          However I hope this can be included in beta-5 so I can get some early feedback.

          Show
          Remko Popma added a comment - - edited Please find attached files LOG4J2-207 -jmx.patch and LOG4J2-207 -jmx-images.zip. Images are used in the manual page, please unzip into src/site/resources/images. This patch provides initial JMX support with MBeans for StatusLogger, ContextSelector, LoggerContext, LoggerConfig and Appender. A number of attributes of these objects can be viewed and some can also be modified in JMX tools like JConsole. Also included is a simple client GUI that can be used to monitor the StatusLogger output and modify the configuration. The client GUI can run stand-alone or as a JConsole plug-in. Maven needs to see the jconsole.jar during the build, so I modified core/pom.xml and added two profiles because apparently on the mac, jconsole.jar lives in $ {java.home}/../Classes/jconsole.jar, not in ${java.home} /../lib/jconsole.jar. I don't have a mac so I was unable to test this. If this breaks the build, you could consider removing the ClientGUIJConsolePlugin.java file. This is the only class that depends on jconsole.jar. This is not the final version, for example there are no stats yet. However I hope this can be included in beta-5 so I can get some early feedback.
          Hide
          Remko Popma added a comment -

          This patch contains one change in the log4j-async module.
          The patch for LOG4J2-208 removes the log4j-async module, so if possible apply this patch before LOG4J2-208.

          Show
          Remko Popma added a comment - This patch contains one change in the log4j-async module. The patch for LOG4J2-208 removes the log4j-async module, so if possible apply this patch before LOG4J2-208 .
          Hide
          Remko Popma added a comment -

          Please find attached file LOG4J2-207-jmx-v2.patch.

          This is a clean patch updated for the recent changes to trunk (especially the removal of the log4j-async module).

          Otherwise no changes.

          I'll remove the old file LOG4J2-207-jmx.patch to avoid confusion.

          Show
          Remko Popma added a comment - Please find attached file LOG4J2-207 -jmx-v2.patch. This is a clean patch updated for the recent changes to trunk (especially the removal of the log4j-async module). Otherwise no changes. I'll remove the old file LOG4J2-207 -jmx.patch to avoid confusion.
          Hide
          Ralph Goers added a comment -

          Patches added in revision 1469973. Please verify and close.

          Show
          Ralph Goers added a comment - Patches added in revision 1469973. Please verify and close.
          Hide
          Remko Popma added a comment -

          Confirmed. All worked fine & docs look good. Glad the profile added to core/pom.xml worked on your mac.

          Show
          Remko Popma added a comment - Confirmed. All worked fine & docs look good. Glad the profile added to core/pom.xml worked on your mac.

            People

            • Assignee:
              Ralph Goers
              Reporter:
              Remko Popma
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development