Package org.opends.server.loggers
Class ConsoleErrorLogPublisher
java.lang.Object
org.opends.server.loggers.ErrorLogPublisher<C>
org.opends.server.loggers.ConsoleErrorLogPublisher
- All Implemented Interfaces:
Closeable,AutoCloseable,ConfigurationChangeListener<ConsoleErrorLogPublisherCfg>,LogPublisher<ConsoleErrorLogPublisherCfg>
public final class ConsoleErrorLogPublisher
extends ErrorLogPublisher<C>
implements ConfigurationChangeListener<ConsoleErrorLogPublisherCfg>
This class provides an implementation of an error log publisher.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionApplies the configuration changes to this change listener.voidclose()Close this publisher.getDN()Gets the DN of the configuration entry for this log publisher.voidinitializeLogPublisher(ConsoleErrorLogPublisherCfg config, ServerContext serverContext) Initializes this publisher provider based on the information in the provided debug publisher configuration.booleanisConfigurationAcceptable(ConsoleErrorLogPublisherCfg config, List<LocalizableMessage> unacceptableReasons) Indicates whether the provided configuration is acceptable for this log publisher.booleanisConfigurationChangeAcceptable(ConsoleErrorLogPublisherCfg config, List<LocalizableMessage> unacceptableReasons) Indicates whether the proposed change to the configuration is acceptable to this change listener.voidlog(String source, long categoryMask, Severity severity, LocalizableMessage message) Writes a message to the error log using the provided information.
-
Constructor Details
-
ConsoleErrorLogPublisher
public ConsoleErrorLogPublisher()
-
-
Method Details
-
initializeLogPublisher
public void initializeLogPublisher(ConsoleErrorLogPublisherCfg config, ServerContext serverContext) throws ConfigException Description copied from interface:LogPublisherInitializes this publisher provider based on the information in the provided debug publisher configuration.- Specified by:
initializeLogPublisherin interfaceLogPublisher<ConsoleErrorLogPublisherCfg>- Parameters:
config- The publisher configuration that contains the information to use to initialize this publisher.serverContext- The server context.- Throws:
ConfigException- If an unrecoverable problem arises in the process of performing the initialization as a result of the server configuration.
-
isConfigurationAcceptable
public boolean isConfigurationAcceptable(ConsoleErrorLogPublisherCfg config, List<LocalizableMessage> unacceptableReasons) Description copied from interface:LogPublisherIndicates 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:
isConfigurationAcceptablein interfaceLogPublisher<ConsoleErrorLogPublisherCfg>- Overrides:
isConfigurationAcceptablein classErrorLogPublisher<ConsoleErrorLogPublisherCfg>- Parameters:
config- 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:
trueif the provided configuration is acceptable for this log publisher, orfalseif not.
-
isConfigurationChangeAcceptable
public boolean isConfigurationChangeAcceptable(ConsoleErrorLogPublisherCfg config, List<LocalizableMessage> unacceptableReasons) Description copied from interface:ConfigurationChangeListenerIndicates whether the proposed change to the configuration is acceptable to this change listener.- Specified by:
isConfigurationChangeAcceptablein interfaceConfigurationChangeListener<ConsoleErrorLogPublisherCfg>- Parameters:
config- The new configuration containing the changes.unacceptableReasons- A list that can be used to hold messages about why the provided configuration is not acceptable.- Returns:
- Returns
trueif the proposed change is acceptable, orfalseif it is not.
-
applyConfigurationChange
Description copied from interface:ConfigurationChangeListenerApplies the configuration changes to this change listener.- Specified by:
applyConfigurationChangein interfaceConfigurationChangeListener<ConsoleErrorLogPublisherCfg>- Parameters:
config- The new configuration containing the changes.- Returns:
- Returns information about the result of changing the configuration.
-
close
public void close()Description copied from interface:LogPublisherClose this publisher.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceLogPublisher<ConsoleErrorLogPublisherCfg>
-
getDN
Description copied from interface:LogPublisherGets the DN of the configuration entry for this log publisher.- Specified by:
getDNin interfaceLogPublisher<ConsoleErrorLogPublisherCfg>- Returns:
- The configuration entry DN.
-
log
Description copied from class:ErrorLogPublisherWrites 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.
- Specified by:
login classErrorLogPublisher<C extends ErrorLogPublisherCfg>- Parameters:
source- The category of the message, which is a category name defined inorg.opends.server.loggers.ServerLoggersinterface.categoryMask- The bitmask of the category.severity- The severity of the message.message- The message to be logged.
-