Class DefaultAuditLogger
java.lang.Object
org.apache.hadoop.hdfs.server.namenode.HdfsAuditLogger
org.apache.hadoop.hdfs.server.namenode.DefaultAuditLogger
- All Implemented Interfaces:
AuditLogger
This class provides an interface for Namenode and Router to Audit events
information. This class can be extended and can be used when no access logger
is defined in the config file.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intThe maximum bytes a caller context string can have.protected intList of commands to provide debug messages.protected booleanprotected booleanadds a tracking ID for all audit log events.protected static final ThreadLocal<StringBuilder> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidinitialize(Configuration conf) Called during initialization of the logger.abstract voidlogAuditEvent(boolean succeeded, String userName, InetAddress addr, String cmd, String src, String dst, FileStatus status, CallerContext callerContext, UserGroupInformation ugi, org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenSecretManager dtSecretManager) Same asHdfsAuditLogger.logAuditEvent(boolean, String, InetAddress, String, String, String, FileStatus)with additional parameters related to logging delegation token tracking IDs.abstract voidlogAuditEvent(boolean succeeded, String userName, InetAddress addr, String cmd, String src, String dst, FileStatus status, UserGroupInformation ugi, org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenSecretManager dtSecretManager) abstract voidlogAuditMessage(String message) Methods inherited from class org.apache.hadoop.hdfs.server.namenode.HdfsAuditLogger
logAuditEvent
-
Field Details
-
STRING_BUILDER
-
isCallerContextEnabled
protected volatile boolean isCallerContextEnabled -
callerContextMaxLen
protected int callerContextMaxLenThe maximum bytes a caller context string can have. -
callerSignatureMaxLen
protected int callerSignatureMaxLen -
logTokenTrackingId
protected boolean logTokenTrackingIdadds a tracking ID for all audit log events. -
debugCmdSet
List of commands to provide debug messages.
-
-
Constructor Details
-
DefaultAuditLogger
public DefaultAuditLogger()
-
-
Method Details
-
initialize
Description copied from interface:AuditLoggerCalled during initialization of the logger.- Parameters:
conf- The configuration object.
-
logAuditMessage
-
logAuditEvent
public abstract void logAuditEvent(boolean succeeded, String userName, InetAddress addr, String cmd, String src, String dst, FileStatus status, UserGroupInformation ugi, org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenSecretManager dtSecretManager) Description copied from class:HdfsAuditLoggerSame asHdfsAuditLogger.logAuditEvent(boolean, String, InetAddress, String, String, String, FileStatus, CallerContext, UserGroupInformation, DelegationTokenSecretManager)withoutCallerContextinformation.- Specified by:
logAuditEventin classHdfsAuditLogger
-
logAuditEvent
public abstract void logAuditEvent(boolean succeeded, String userName, InetAddress addr, String cmd, String src, String dst, FileStatus status, CallerContext callerContext, UserGroupInformation ugi, org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenSecretManager dtSecretManager) Description copied from class:HdfsAuditLoggerSame asHdfsAuditLogger.logAuditEvent(boolean, String, InetAddress, String, String, String, FileStatus)with additional parameters related to logging delegation token tracking IDs.- Specified by:
logAuditEventin classHdfsAuditLogger- Parameters:
succeeded- Whether authorization succeeded.userName- Name of the user executing the request.addr- Remote address of the request.cmd- The requested command.src- Path of affected source file.dst- Path of affected destination file (if any).status- File information for operations that change the file's metadata (permissions, owner, times, etc).callerContext- Context information of the callerugi- UserGroupInformation of the current user, or null if not logging token tracking informationdtSecretManager- The token secret manager, or null if not logging token tracking information
-