Class JMXLogHandler


  • public class JMXLogHandler
    extends java.util.logging.StreamHandler
    LogHandler that provides the JUL log outputs as a counter per log-level for JMX.

    Add this handler to the JUL logging.properties configuration file to the handlers property:

         .level=INFO
         ...
         handlers=...,com.zfabrik.util.logging.JMXLogHandler
         ...
     
    The handler exposes the following counters as JMX attributes under zfabrik/com.zfabrik.logging/JULMetrics:
    • LogFinest - counts the number of log entries of the FINEST level
    • LogFiner - counts the number of log entries of the FINER level
    • LogFine - counts the number of log entries of the FINE level
    • LogConfig - counts the number of log entries of the CONFIG level
    • LogInfo - counts the number of log entries of the INFO level
    • LogWarning - counts the number of log entries of the WARNING level
    • LogSevere - counts the number of log entries of the SEVERE level
    • Constructor Summary

      Constructors 
      Constructor Description
      JMXLogHandler()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void publish​(java.util.logging.LogRecord record)  
      • Methods inherited from class java.util.logging.StreamHandler

        close, flush, isLoggable, setEncoding, setOutputStream
      • Methods inherited from class java.util.logging.Handler

        getEncoding, getErrorManager, getFilter, getFormatter, getLevel, reportError, setErrorManager, setFilter, setFormatter, setLevel
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JMXLogHandler

        public JMXLogHandler()
    • Method Detail

      • publish

        public void publish​(java.util.logging.LogRecord record)
        Overrides:
        publish in class java.util.logging.StreamHandler