maoling commented on a change in pull request #1536:
URL: https://github.com/apache/zookeeper/pull/1536#discussion_r523392216
##########
File path:
zookeeper-server/src/main/java/org/apache/zookeeper/audit/ZKAuditProvider.java
##########
@@ -119,7 +121,9 @@ public static void addServerStartFailureAuditLog() {
}
private static void log(String user, String operation, Result result) {
- auditLogger.logAuditEvent(createLogEvent(user, operation, result));
+ if (isAuditEnabled()) {
+ auditLogger.logAuditEvent(createLogEvent(user, operation, result));
+ }
}
Review comment:
This method is the same, when `'AUDIT_ENABLE'` is false, the program
cannot run at here, so no NPE issue. Am I missing something?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]