Class TLcdLoggerFactory

java.lang.Object
com.luciad.util.logging.TLcdLoggerFactory

public class TLcdLoggerFactory extends Object
Main entry point of all logging in LuciadLightspeed and LuciadFusion, delegating to a configured 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 own ILcdLoggerFactory 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 the ILcdLoggerFactory 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 where TLcdLoggerFactory 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 the getLogger(java.lang.String) methods for your own logging purposes, but there is no special advantage doing so.
Since:
9.0
  • Method Details

    • getLogger

      public static ILcdLogger getLogger(String aLoggerName)
      Returns the ILcdLogger having the given name.
      Parameters:
      aLoggerName - the logger name.
      Returns:
      the ILcdLogger.
    • getLogger

      public static ILcdLogger getLogger(Class aClass)
      Returns the ILcdLogger having the name of the given class.
      Parameters:
      aClass - the class for which to create the logger.
      Returns:
      the ILcdLogger