Package org.opends.server.loggers
Class AccessLogger
java.lang.Object
org.opends.server.loggers.AbstractLogger<AccessLogPublisher<AccessLogPublisherCfg>,AccessLogPublisherCfg>
org.opends.server.loggers.AccessLogger
- All Implemented Interfaces:
ConfigurationAddListener<AccessLogPublisherCfg>
,ConfigurationChangeListener<AccessLogPublisherCfg>
,ConfigurationDeleteListener<AccessLogPublisherCfg>
public final class AccessLogger
extends AbstractLogger<AccessLogPublisher<AccessLogPublisherCfg>,AccessLogPublisherCfg>
This class defines the wrapper that will invoke all registered access loggers for each type of request received or
response sent.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addLogPublisher
(AccessLogPublisher<AccessLogPublisherCfg> publisher) Add a log publisher to the logger.static AccessLogger
Retrieve the singleton instance of this class.protected ClassPropertyDefinition
Returns the javaClassPropertyDefinition
for the current logger.protected Collection<AccessLogPublisher<AccessLogPublisherCfg>>
Returns the log publishers.static void
logConnect
(ClientConnection connection) Writes a message to the access logger with information about a new client connection that has been established, regardless of whether it will be immediately terminated.static void
logDisconnect
(ClientConnection connection, DisconnectReason disconnectReason, LocalizableMessage message) Writes a message to the access logger with information about the termination of an existing client connection.static void
logRequest
(RequestContext context, Request request) Writes a message to the access logger with information about the provided request.static void
logResult
(RequestContext context, Request request, Result result) Writes a message to the access logger with information about the provided request and result.void
Removes all existing log publishers from the logger.void
Remove a log publisher from the logger.Methods inherited from class org.opends.server.loggers.AbstractLogger
applyConfigurationAdd, applyConfigurationChange, applyConfigurationDelete, initializeLogger, isConfigurationAddAcceptable, isConfigurationChangeAcceptable, isConfigurationDeleteAcceptable, modifyLogPublisher
-
Method Details
-
getJavaClassPropertyDefinition
Description copied from class:AbstractLogger
Returns the javaClassPropertyDefinition
for the current logger.- Specified by:
getJavaClassPropertyDefinition
in classAbstractLogger<AccessLogPublisher<AccessLogPublisherCfg>,
AccessLogPublisherCfg> - Returns:
- the java
ClassPropertyDefinition
for the current logger.
-
getLogPublishers
Description copied from class:AbstractLogger
Returns the log publishers.- Specified by:
getLogPublishers
in classAbstractLogger<AccessLogPublisher<AccessLogPublisherCfg>,
AccessLogPublisherCfg> - Returns:
- the collection of
LogPublisher
s
-
getInstance
Retrieve the singleton instance of this class.- Returns:
- The singleton instance of this logger.
-
logConnect
Writes a message to the access logger with information about a new client connection that has been established, regardless of whether it will be immediately terminated.- Parameters:
connection
- The client connection that has been established.
-
logDisconnect
public static void logDisconnect(ClientConnection connection, DisconnectReason disconnectReason, LocalizableMessage message) Writes a message to the access logger with information about the termination of an existing client connection.- Parameters:
connection
- The client connection that has been terminated.disconnectReason
- A generic disconnect reason for the connection termination.message
- A human-readable message that can provide additional information about the disconnect.
-
addLogPublisher
Description copied from class:AbstractLogger
Add a log publisher to the logger.- Specified by:
addLogPublisher
in classAbstractLogger<AccessLogPublisher<AccessLogPublisherCfg>,
AccessLogPublisherCfg> - Parameters:
publisher
- The log publisher to add.
-
removeLogPublisher
Description copied from class:AbstractLogger
Remove a log publisher from the logger.- Specified by:
removeLogPublisher
in classAbstractLogger<AccessLogPublisher<AccessLogPublisherCfg>,
AccessLogPublisherCfg> - Parameters:
publisher
- The log publisher to remove.
-
removeAllLogPublishers
public void removeAllLogPublishers()Description copied from class:AbstractLogger
Removes all existing log publishers from the logger.- Specified by:
removeAllLogPublishers
in classAbstractLogger<AccessLogPublisher<AccessLogPublisherCfg>,
AccessLogPublisherCfg>
-
logRequest
Writes a message to the access logger with information about the provided request.- Parameters:
context
- the request contextrequest
- the request to log
-
logResult
Writes a message to the access logger with information about the provided request and result.- Parameters:
context
- the request contextrequest
- the request to logresult
- the result to log
-