Class LoggingRegistry
- java.lang.Object
 - 
- com.snowtide.util.logging.LoggingRegistry
 
 
- 
public class LoggingRegistry extends Object
This class is provided to allow applications that use PDFxStream to supply custom logging implementations.
Classes may be registered with this class that implement the
LogFactoryinterface. Note that this class will create an instance of the implementation class(es) provided to it using the Java Reflection API; this requires that the LogFactory implementation class have a no-arg constructor.If no custom LogFactory class is registered, then PDFxStream will use a default logging implementation that will use the following logging toolkits, in the following order of preference:
- The java.util.logging API
 - Log4J
 - A fallback implementation that outputs all logging messages to System.out
 
Log4J can be given preference over java.util.logging by setting the system property
pdfxs.loggingtypetolog4j.CRITICAL: If a custom logging implementation is to be used, it must be registered with this class before referencing any other PDFxStream classes. This is because PDFxStream retrieves all of the
Logimplementations it needs when its classes are first initialized, which is done when it is first used by outside application code.Ensuring that this occurs is easy. Either:
- Set the 
pdfxs.logfactorysystem property to the full classname of yourLogFactoryimplementation - Programmatically register your 
LogFactoryimplementation with this class in a static initializer block in your application:static { LoggingRegistry.register(MyLogFactoryImpl.class); } 
- Version:
 - ©2004-2025 Snowtide
 
 
- 
- 
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static LoggetLog(Class c)Convenience method for retrieving a Log instance for the given Class from the current LogFactory.static LoggetLog(String logname)Convenience method for retrieving a Log instance with the given name from the current LogFactory.static voidregisterFactory(LogFactory impl)Registers the given LogFactory instance as the designated LogFactory implementation for creatingLogobjects. 
 - 
 
- 
- 
Method Detail
- 
registerFactory
public static void registerFactory(LogFactory impl)
Registers the given LogFactory instance as the designated LogFactory implementation for creatingLogobjects.- Parameters:
 impl- aLogFactoryimplementation
 
- 
getLog
public static Log getLog(Class c)
Convenience method for retrieving a Log instance for the given Class from the current LogFactory. 
 - 
 
 -