Class TLcdMBeanPerformanceLogHandler

java.lang.Object
java.util.logging.Handler
com.luciad.util.logging.TLcdMBeanPerformanceLogHandler

public class TLcdMBeanPerformanceLogHandler extends Handler

A log Handler that expects LogRecords containing timing information in the form of MBean components. The components are registered automatically with the default platform MBean server.

Performance logging can be enabled with a logging properties file (see Developer's guide) or programmatically:


  Logger perfLogger = Logger.getLogger( "performance.com.luciad" );
  perfLogger.addHandler( new TLcdMBeanPerformanceLogHandler() );
  perfLogger.setUseParentHandlers( false );
  perfLogger.setLevel( Level.FINEST );
 
Since:
9.0
  • Constructor Details

    • TLcdMBeanPerformanceLogHandler

      public TLcdMBeanPerformanceLogHandler()
      Constructs a TLcdMBeanPerformanceLogHandler.
  • Method Details

    • publish

      public void publish(LogRecord aLogRecord)
      Registers new MBeans with the server, or sends notifications for the ones already registered. The arguments is a LogRecord whose parameters are expected to have one of the following two layouts:
      • [monitored_object, mbean_name, mbean], or
      • [monitored_object, mbean_name, mbean, parent_mbean]
      Where:
      • monitored_object is the LuciadLightspeed object to which the MBean component corresponds. When this object is garbage collected, its MBean is automatically unregistered by the cleanup method.
      • mbean_name:
        • in case #1 (no parent_mbean): "performance.com.luciad.<...>:key=value"
        • in case #2 (parent_mbean) : "key=value"
      • mbean: the MBean to register
      • mbean_parent: an MBean that is a logical container of this one (eg. a view MBean is the parent of a layer MBean)
      Specified by:
      publish in class Handler
      Parameters:
      aLogRecord - a log record containing an MBean among its parameters.
    • flush

      public void flush()
      Specified by:
      flush in class Handler
    • close

      public void close() throws SecurityException
      Specified by:
      close in class Handler
      Throws:
      SecurityException