Package org.opends.server.loggers
Class ErrorLogPublisher<T extends ErrorLogPublisherCfg>
- java.lang.Object
-
- org.opends.server.loggers.ErrorLogPublisher<T>
-
- Type Parameters:
T
- The type of error log publisher configuration handled by this log publisher implementation.
- All Implemented Interfaces:
Closeable
,AutoCloseable
,LogPublisher<T>
- Direct Known Subclasses:
ConsoleErrorLogPublisher
,TextErrorLogPublisher
@PublicAPI(stability=VOLATILE, mayExtend=true) public abstract class ErrorLogPublisher<T extends ErrorLogPublisherCfg> extends Object implements LogPublisher<T>
This class defines the set of methods and structures that must be implemented for a Directory Server error log publisher.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
isConfigurationAcceptable(T configuration, List<LocalizableMessage> unacceptableReasons)
Indicates whether the provided configuration is acceptable for this log publisher.abstract void
log(String category, Severity severity, LocalizableMessage message, Throwable exception)
Writes a message to the error log using the provided information.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opends.server.loggers.LogPublisher
close, getDN, initializeLogPublisher
-
-
-
-
Method Detail
-
isConfigurationAcceptable
public boolean isConfigurationAcceptable(T configuration, List<LocalizableMessage> unacceptableReasons)
Description copied from interface:LogPublisher
Indicates whether the provided configuration is acceptable for this log publisher. It should be possible to call this method on an uninitialized log publisher instance in order to determine whether the log publisher would be able to use the provided configuration.- Specified by:
isConfigurationAcceptable
in interfaceLogPublisher<T extends ErrorLogPublisherCfg>
- Parameters:
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.- Returns:
true
if the provided configuration is acceptable for this log publisher, orfalse
if not.
-
log
public abstract void log(String category, Severity severity, LocalizableMessage message, Throwable exception)
Writes a message to the error log using the provided information.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.- Parameters:
category
- The category of the message, which is either a classname or a simple category name defined inLoggingCategoryNames
class.severity
- The severity of the message.message
- The message to be logged.exception
- The exception to be logged. May benull
.
-
-