Package com.luciad.util.logging
Class TLcdMBeanPerformanceLogHandler
java.lang.Object
java.util.logging.Handler
com.luciad.util.logging.TLcdMBeanPerformanceLogHandler
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 Summary
ConstructorDescriptionConstructs a TLcdMBeanPerformanceLogHandler. -
Method Summary
Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
-
Constructor Details
-
TLcdMBeanPerformanceLogHandler
public TLcdMBeanPerformanceLogHandler()Constructs a TLcdMBeanPerformanceLogHandler.
-
-
Method Details
-
publish
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]
- 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"
- in case #1 (no parent_mbean):
- 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)
-
flush
public void flush() -
close
- Specified by:
close
in classHandler
- Throws:
SecurityException
-