T
- The type of error log publisher configuration handled by this log publisher implementation.@PublicAPI(stability=VOLATILE, mayInstantiate=false, mayExtend=true, mayInvoke=false) public abstract class ErrorLogPublisher<T extends ErrorLogPublisherCfg> extends Object implements LogPublisher<T>
Modifier and Type | Field and Description |
---|---|
protected Set<Severity> |
defaultSeverities
The set of default log severities that will be used if no custom severities have been defined for the associated
category.
|
protected Map<String,Set<Severity>> |
definedSeverities
The hash map that will be used to define specific log severities for the various categories.
|
Constructor and Description |
---|
ErrorLogPublisher() |
Modifier and Type | Method and Description |
---|---|
boolean |
isConfigurationAcceptable(T configuration,
List<LocalizableMessage> unacceptableReasons)
Indicates whether the provided configuration is acceptable for this log publisher.
|
abstract boolean |
isEnabledFor(String category,
Severity severity)
Check if a message should be logged for the provided category and severity.
|
abstract void |
log(String category,
Severity severity,
LocalizableMessage message,
Throwable exception)
Writes a message to the error log using the provided information.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, getDN, initializeLogPublisher
protected Map<String,Set<Severity>> definedSeverities
public boolean isConfigurationAcceptable(T configuration, List<LocalizableMessage> unacceptableReasons)
LogPublisher
isConfigurationAcceptable
in interface LogPublisher<T extends ErrorLogPublisherCfg>
configuration
- The log publisher configuration for which to make the determination.unacceptableReasons
- A list that may be used to hold the reasons that the provided configuration is not acceptable.true
if the provided configuration is acceptable for this log publisher, or false
if not.public abstract void log(String category, Severity severity, LocalizableMessage message, Throwable exception)
The category and severity information are used to determine whether to actually log this message.
Category is defined using either short name (used for classes in well defined packages) or fully qualified
classname. Conversion to short name is done automatically when loggers are created, see
LoggingCategoryNames
for list of existing short names.
category
- The category of the message, which is either a classname or a simple category name defined in
LoggingCategoryNames
class.severity
- The severity of the message.message
- The message to be logged.exception
- The exception to be logged. May be null
.public abstract boolean isEnabledFor(String category, Severity severity)
category
- The category of the message, which is either a classname or a simple category name defined in
LoggingCategoryNames
class.severity
- The severity of the message.true
if the message should be logged, false
otherwiseCopyright 2010-2022 ForgeRock AS.