diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/security/RouterSecurityAuditLogger.java b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/security/RouterSecurityAuditLogger.java index 0c4b4b9d275..6eb5fe0ac80 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/security/RouterSecurityAuditLogger.java +++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/security/RouterSecurityAuditLogger.java @@ -1,3 +1,21 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.apache.hadoop.hdfs.server.federation.router.security; import org.apache.hadoop.classification.VisibleForTesting; @@ -14,7 +32,7 @@ import static org.apache.hadoop.fs.CommonConfigurationKeysPublic.HADOOP_CALLER_C public class RouterSecurityAuditLogger { - public static final Logger auditLog = LoggerFactory.getLogger( + public static final Logger AUDIT_LOG = LoggerFactory.getLogger( RouterSecurityManager.class.getName() + ".audit"); private static final ThreadLocal STRING_BUILDER = @@ -40,7 +58,7 @@ public class RouterSecurityAuditLogger { public void logAuditEvent(boolean succeeded, String userName, InetAddress addr, String cmd, CallerContext callerContext, String tokenId) { - if (auditLog.isDebugEnabled() || auditLog.isInfoEnabled()) { + if (AUDIT_LOG.isDebugEnabled() || AUDIT_LOG.isInfoEnabled()) { logAuditMessage( creatAuditLog(succeeded, userName, addr, cmd, callerContext, tokenId)); @@ -85,7 +103,7 @@ public class RouterSecurityAuditLogger { } private void logAuditMessage(String message) { - auditLog.info(message); + AUDIT_LOG.info(message); } } \ No newline at end of file