public final class DebugLogger extends AbstractLogger<DebugLogPublisher<DebugLogPublisherCfg>,DebugLogPublisherCfg>
AbstractLogger.LoggerStorage<P extends LogPublisher<C>,C extends LogPublisherCfg>
Modifier and Type | Method and Description |
---|---|
void |
addLogPublisher(DebugLogPublisher<DebugLogPublisherCfg> publisher)
Add a log publisher to the logger.
|
TextDebugLogPublisher |
addPublisherIfRequired(TextWriter writer)
Adds a text debug log publisher that will print all messages to the provided writer, based on debug target(s)
defined through system properties.
|
static boolean |
debugEnabled()
Indicates if debug logging is enabled.
|
static DebugLogger |
getInstance()
Retrieve the singleton instance of this class.
|
protected ClassPropertyDefinition |
getJavaClassPropertyDefinition()
Returns the java
ClassPropertyDefinition for the current logger. |
protected Collection<DebugLogPublisher<DebugLogPublisherCfg>> |
getLogPublishers()
Returns the log publishers.
|
static DebugTracer |
getTracer(String className)
Returns the registered Debug Tracer for a traced class.
|
boolean |
isEnabled()
Returns whether there is at least one debug log publisher enabled.
|
void |
removeAllLogPublishers()
Removes all existing log publishers from the logger.
|
boolean |
removeLogPublisher(DebugLogPublisher<DebugLogPublisherCfg> publisher)
Remove a log publisher from the logger.
|
applyConfigurationAdd, applyConfigurationChange, applyConfigurationDelete, initializeLogger, isConfigurationAddAcceptable, isConfigurationChangeAcceptable, isConfigurationDeleteAcceptable
protected ClassPropertyDefinition getJavaClassPropertyDefinition()
AbstractLogger
ClassPropertyDefinition
for the current logger.getJavaClassPropertyDefinition
in class AbstractLogger<DebugLogPublisher<DebugLogPublisherCfg>,DebugLogPublisherCfg>
ClassPropertyDefinition
for the current logger.protected Collection<DebugLogPublisher<DebugLogPublisherCfg>> getLogPublishers()
AbstractLogger
getLogPublishers
in class AbstractLogger<DebugLogPublisher<DebugLogPublisherCfg>,DebugLogPublisherCfg>
LogPublisher
spublic static boolean debugEnabled()
public static DebugLogger getInstance()
public static DebugTracer getTracer(String className)
className
- The name of the class tracer to retrieve.public final TextDebugLogPublisher addPublisherIfRequired(TextWriter writer)
It is expected that one or more system properties beginning with PROPERTY_DEBUG_TARGET
are set to define
the properties of the debug targets used by the publisher, otherwise no publisher is added.
writer
- The text writer where the message will be written to.null
if no publisher is added.public final void addLogPublisher(DebugLogPublisher<DebugLogPublisherCfg> publisher)
AbstractLogger
addLogPublisher
in class AbstractLogger<DebugLogPublisher<DebugLogPublisherCfg>,DebugLogPublisherCfg>
publisher
- The log publisher to add.public final boolean removeLogPublisher(DebugLogPublisher<DebugLogPublisherCfg> publisher)
AbstractLogger
removeLogPublisher
in class AbstractLogger<DebugLogPublisher<DebugLogPublisherCfg>,DebugLogPublisherCfg>
publisher
- The log publisher to remove.public final void removeAllLogPublishers()
AbstractLogger
removeAllLogPublishers
in class AbstractLogger<DebugLogPublisher<DebugLogPublisherCfg>,DebugLogPublisherCfg>
public boolean isEnabled()
Copyright 2010-2020 ForgeRock AS.