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 TypeMethodDescriptionvoidaddLogPublisher(AccessLogPublisher<AccessLogPublisherCfg> publisher) Add a log publisher to the logger.static AccessLoggerRetrieve the singleton instance of this class.protected ClassPropertyDefinitionReturns the javaClassPropertyDefinitionfor the current logger.protected Collection<AccessLogPublisher<AccessLogPublisherCfg>>Returns the log publishers.static voidlogConnect(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 voidlogDisconnect(ClientConnection connection, DisconnectReason disconnectReason, LocalizableMessage message) Writes a message to the access logger with information about the termination of an existing client connection.static voidlogRequest(RequestContext context, Request request) Writes a message to the access logger with information about the provided request.static voidlogResult(RequestContext context, Request request, Result result) Writes a message to the access logger with information about the provided request and result.voidRemoves all existing log publishers from the logger.voidRemove 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:AbstractLoggerReturns the javaClassPropertyDefinitionfor the current logger.- Specified by:
getJavaClassPropertyDefinitionin classAbstractLogger<AccessLogPublisher<AccessLogPublisherCfg>,AccessLogPublisherCfg> - Returns:
- the java
ClassPropertyDefinitionfor the current logger.
-
getLogPublishers
Description copied from class:AbstractLoggerReturns the log publishers.- Specified by:
getLogPublishersin classAbstractLogger<AccessLogPublisher<AccessLogPublisherCfg>,AccessLogPublisherCfg> - Returns:
- the collection of
LogPublishers
-
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:AbstractLoggerAdd a log publisher to the logger.- Specified by:
addLogPublisherin classAbstractLogger<AccessLogPublisher<AccessLogPublisherCfg>,AccessLogPublisherCfg> - Parameters:
publisher- The log publisher to add.
-
removeLogPublisher
Description copied from class:AbstractLoggerRemove a log publisher from the logger.- Specified by:
removeLogPublisherin classAbstractLogger<AccessLogPublisher<AccessLogPublisherCfg>,AccessLogPublisherCfg> - Parameters:
publisher- The log publisher to remove.
-
removeAllLogPublishers
public void removeAllLogPublishers()Description copied from class:AbstractLoggerRemoves all existing log publishers from the logger.- Specified by:
removeAllLogPublishersin 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
-