Package com.luciad.util.logging
Class TLcdLoggerFactory
java.lang.Object
com.luciad.util.logging.TLcdLoggerFactory
Main entry point of all logging in LuciadLightspeed and LuciadFusion, delegating to a configured
For example, this class configures LuciadLightspeed/LuciadFusion to use the java.util.logging framework for all logging purposes:
ILcdLoggerFactory
using Java's services mechanism. By default, the java.util.logging framework is used.
Framework selection using annotation processing
If you've enabled annotation processing, simply annotate your ownILcdLoggerFactory with the @LcdService annotation.
You can also extend an existing logger factory and annotate that class.For example, this class configures LuciadLightspeed/LuciadFusion to use the java.util.logging framework for all logging purposes:
@LcdService
public class JULLoggerFactory extends TLcdJULLoggerFactory {}
Manual framework selection
This class retrieves theILcdLoggerFactory implementation class from the non-commented (using #)
lines of a configuration file in your class path called:
META-INF/services/com.luciad.util.logging.ILcdLoggerFactory
For example, if the file contains the following:
# Make LuciadLightspeed logging use the standard java.util.logging framework
com.luciad.util.logging.TLcdJULLoggerFactory
then the TLcdJULLoggerFactory class will be used for creating
concrete ILcdLogger objects.
Troubleshooting
You can find out whereTLcdLoggerFactory is picking up the logging framework by
passing "-Dcom.luciad.util.logging.trace=true" to the java startup parameters.
Usage
You are free to use thegetLogger(java.lang.String) methods for your own logging purposes,
but there is no special advantage doing so.- Since:
- 9.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic ILcdLoggerReturns theILcdLoggerhaving the name of the given class.static ILcdLoggerReturns theILcdLoggerhaving the given name.
-
Method Details
-
getLogger
Returns theILcdLoggerhaving the given name.- Parameters:
aLoggerName- the logger name.- Returns:
- the
ILcdLogger.
-
getLogger
Returns theILcdLoggerhaving the name of the given class.- Parameters:
aClass- the class for which to create the logger.- Returns:
- the
ILcdLogger
-