|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.snowtide.util.logging.LoggingRegistry
public class LoggingRegistry
This class is provided to allow applications that use PDFTextStream to supply custom logging implementations.
Classes may be registered with this class that implement the
LogFactory
interface. Note that
this class will create an instance of the implemenation 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 PDFTextStream will use a default logging implementation that will use the following logging toolkits, in the following order of preference:
Log4J can be given preference over java.util.logging by setting the system property
pdfts.loggingtype
to log4j
.
CRITICAL: If a custom logging implementation is to be used,
it must be registered with this class before referencing any
other PDFTextStream classes. This is because PDFTextStream retrieves all of the
Log
implementations 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:
pdfts.logfactory
system property to the full classname of your
LogFactory
implementationLogFactory
implementation with this class in a static initializer block in your application:
static { LoggingRegistry.register(MyLogFactoryImpl.class); }
Method Summary | |
---|---|
static Log |
getLog(java.lang.Class c)
Convenience method for retrieving a Log instance for the given Class from the current LogFactory. |
static Log |
getLog(java.lang.String logname)
Convenience method for retrieving a Log instance with the given name from the current LogFactory. |
static void |
registerFactory(LogFactory impl)
Registers the given LogFactory instance as the designated LogFactory implementation for creating Log objects. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void registerFactory(LogFactory impl)
Log
objects.
impl
- - a LogFactory
implementationpublic static Log getLog(java.lang.Class c)
public static Log getLog(java.lang.String logname)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |