Package org.opends.server.loggers
Class TextHTTPAccessLogPublisher
java.lang.Object
org.opends.server.loggers.HTTPAccessLogPublisher<FileBasedHttpAccessLogPublisherCfg>
org.opends.server.loggers.TextHTTPAccessLogPublisher
- All Implemented Interfaces:
Closeable,AutoCloseable,ConfigurationChangeListener<FileBasedHttpAccessLogPublisherCfg>,LogPublisher<FileBasedHttpAccessLogPublisherCfg>
public final class TextHTTPAccessLogPublisher
extends HTTPAccessLogPublisher<FileBasedHttpAccessLogPublisherCfg>
implements ConfigurationChangeListener<FileBasedHttpAccessLogPublisherCfg>
This class provides the implementation of the HTTP access logger used by the directory server.
-
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.static TextHTTPAccessLogPublisherReturns an instance of the text HTTP access log publisher that will print all messages to the provided writer.voidinitializeLogPublisher(FileBasedHttpAccessLogPublisherCfg cfg, ServerContext serverContext) Initializes this publisher provider based on the information in the provided debug publisher configuration.booleanisConfigurationAcceptable(FileBasedHttpAccessLogPublisherCfg configuration, List<LocalizableMessage> unacceptableReasons) Indicates whether the provided configuration is acceptable for this log publisher.booleanisConfigurationChangeAcceptable(FileBasedHttpAccessLogPublisherCfg config, List<LocalizableMessage> unacceptableReasons) Indicates whether the proposed change to the configuration is acceptable to this change listener.voidLogs the request info according to the configured extended log format.
-
Constructor Details
-
TextHTTPAccessLogPublisher
public TextHTTPAccessLogPublisher()
-
-
Method Details
-
getStartupTextHTTPAccessPublisher
Returns an instance of the text HTTP access log publisher that will print all messages to the provided writer. This is used to print the messages to the console when the server starts up.- Parameters:
writer- The text writer where the message will be written to.- Returns:
- The instance of the text error log publisher that will print all messages to standard out.
-
applyConfigurationChange
Description copied from interface:ConfigurationChangeListenerApplies the configuration changes to this change listener.- Specified by:
applyConfigurationChangein interfaceConfigurationChangeListener<FileBasedHttpAccessLogPublisherCfg>- Parameters:
config- The new configuration containing the changes.- Returns:
- Returns information about the result of changing the configuration.
-
initializeLogPublisher
public void initializeLogPublisher(FileBasedHttpAccessLogPublisherCfg cfg, ServerContext serverContext) throws InitializationException Description copied from interface:LogPublisherInitializes this publisher provider based on the information in the provided debug publisher configuration.- Specified by:
initializeLogPublisherin interfaceLogPublisher<FileBasedHttpAccessLogPublisherCfg>- Parameters:
cfg- The publisher configuration that contains the information to use to initialize this publisher.serverContext- The server context.- Throws:
InitializationException- If a problem occurs during initialization that is not related to the server configuration.
-
isConfigurationAcceptable
public boolean isConfigurationAcceptable(FileBasedHttpAccessLogPublisherCfg configuration, 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<FileBasedHttpAccessLogPublisherCfg>- Overrides:
isConfigurationAcceptablein classHTTPAccessLogPublisher<FileBasedHttpAccessLogPublisherCfg>- 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:
trueif the provided configuration is acceptable for this log publisher, orfalseif not.
-
isConfigurationChangeAcceptable
public boolean isConfigurationChangeAcceptable(FileBasedHttpAccessLogPublisherCfg 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<FileBasedHttpAccessLogPublisherCfg>- 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.
-
close
public void close()Description copied from interface:LogPublisherClose this publisher.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceLogPublisher<FileBasedHttpAccessLogPublisherCfg>
-
getDN
Description copied from interface:LogPublisherGets the DN of the configuration entry for this log publisher.- Specified by:
getDNin interfaceLogPublisher<FileBasedHttpAccessLogPublisherCfg>- Returns:
- The configuration entry DN.
-
logRequestInfo
Description copied from class:HTTPAccessLogPublisherLogs the request info according to the configured extended log format.- Overrides:
logRequestInfoin classHTTPAccessLogPublisher<FileBasedHttpAccessLogPublisherCfg>- Parameters:
ri- The request info to log- See Also:
-