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
-
Method Summary
Modifier and TypeMethodDescriptionApplies the configuration changes to this change listener.void
close()
Close this publisher.getDN()
Gets the DN of the configuration entry for this log publisher.static TextHTTPAccessLogPublisher
Returns an instance of the text HTTP access log publisher that will print all messages to the provided writer.void
initializeLogPublisher
(FileBasedHttpAccessLogPublisherCfg cfg, ServerContext serverContext) Initializes this publisher provider based on the information in the provided debug publisher configuration.boolean
isConfigurationAcceptable
(FileBasedHttpAccessLogPublisherCfg configuration, List<LocalizableMessage> unacceptableReasons) Indicates whether the provided configuration is acceptable for this log publisher.boolean
isConfigurationChangeAcceptable
(FileBasedHttpAccessLogPublisherCfg config, List<LocalizableMessage> unacceptableReasons) Indicates whether the proposed change to the configuration is acceptable to this change listener.void
Logs 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:ConfigurationChangeListener
Applies the configuration changes to this change listener.- Specified by:
applyConfigurationChange
in 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:LogPublisher
Initializes this publisher provider based on the information in the provided debug publisher configuration.- Specified by:
initializeLogPublisher
in 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: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<FileBasedHttpAccessLogPublisherCfg>
- Overrides:
isConfigurationAcceptable
in 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:
true
if the provided configuration is acceptable for this log publisher, orfalse
if not.
-
isConfigurationChangeAcceptable
public boolean isConfigurationChangeAcceptable(FileBasedHttpAccessLogPublisherCfg config, List<LocalizableMessage> unacceptableReasons) Description copied from interface:ConfigurationChangeListener
Indicates whether the proposed change to the configuration is acceptable to this change listener.- Specified by:
isConfigurationChangeAcceptable
in 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
true
if the proposed change is acceptable, orfalse
if it is not.
-
close
public void close()Description copied from interface:LogPublisher
Close this publisher.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceLogPublisher<FileBasedHttpAccessLogPublisherCfg>
-
getDN
Description copied from interface:LogPublisher
Gets the DN of the configuration entry for this log publisher.- Specified by:
getDN
in interfaceLogPublisher<FileBasedHttpAccessLogPublisherCfg>
- Returns:
- The configuration entry DN.
-
logRequestInfo
Description copied from class:HTTPAccessLogPublisher
Logs the request info according to the configured extended log format.- Overrides:
logRequestInfo
in classHTTPAccessLogPublisher<FileBasedHttpAccessLogPublisherCfg>
- Parameters:
ri
- The request info to log- See Also:
-