Package org.apache.zookeeper.audit
Class ZKAuditProvider
java.lang.Object
org.apache.zookeeper.audit.ZKAuditProvider
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidAdd audit log for server start fail.static voidAdd audit log for server start and register server stop log.static voidInitializes the audit state and reports any logger initialization failure.static voidconfigureAuditLogger(String loggerClass) Configures the audit logger class without initializing the logger.static StringUser who has started the ZooKeeper server user, it will be the logged-in user.static booleanstatic voidlog(String user, String operation, String znode, String acl, String createMode, String session, String ip, AuditEvent.Result result) static voidlog(String user, String operation, AuditEvent.Result result) Logs an operation without session, IP, or znode fields when auditing is enabled.
-
Field Details
-
AUDIT_ENABLE
System property that enables audit logging.- See Also:
-
-
Constructor Details
-
ZKAuditProvider
public ZKAuditProvider()
-
-
Method Details
-
configureAuditLogger
Configures the audit logger class without initializing the logger.- Throws:
IllegalArgumentException- if another audit logger class has already been selected
-
checkAuditState
public static void checkAuditState()Initializes the audit state and reports any logger initialization failure.- Throws:
IllegalStateException- if the audit logger could not be initialized
-
isAuditEnabled
public static boolean isAuditEnabled()- Returns:
- true if audit logging is configured as enabled
-
log
-
addZKStartStopAuditLog
public static void addZKStartStopAuditLog()Add audit log for server start and register server stop log. -
addServerStartFailureAuditLog
public static void addServerStartFailureAuditLog()Add audit log for server start fail. Audit errors must not prevent the server from exiting with its intended code. -
log
Logs an operation without session, IP, or znode fields when auditing is enabled. -
getZKUser
User who has started the ZooKeeper server user, it will be the logged-in user. If no user logged-in then system user.
-