Class ZKAuditProvider

java.lang.Object
org.apache.zookeeper.audit.ZKAuditProvider

public class ZKAuditProvider extends Object
  • Field Details

  • Constructor Details

    • ZKAuditProvider

      public ZKAuditProvider()
  • Method Details

    • configureAuditLogger

      public static void configureAuditLogger(String loggerClass)
      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

      public static void log(String user, String operation, String znode, String acl, String createMode, String session, String ip, AuditEvent.Result result)
    • 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

      public static void log(String user, String operation, AuditEvent.Result result)
      Logs an operation without session, IP, or znode fields when auditing is enabled.
    • getZKUser

      public static String getZKUser()
      User who has started the ZooKeeper server user, it will be the logged-in user. If no user logged-in then system user.