diff --git a/hadoop-common-project/hadoop-kms/src/main/java/org/apache/hadoop/crypto/key/kms/server/KMS.java b/hadoop-common-project/hadoop-kms/src/main/java/org/apache/hadoop/crypto/key/kms/server/KMS.java index 5873c7a501..27cc05d7ee 100644 --- a/hadoop-common-project/hadoop-kms/src/main/java/org/apache/hadoop/crypto/key/kms/server/KMS.java +++ b/hadoop-common-project/hadoop-kms/src/main/java/org/apache/hadoop/crypto/key/kms/server/KMS.java @@ -70,7 +70,7 @@ public enum KMSOp { private KeyProviderCryptoExtension provider; private KMSAudit kmsAudit; - private static final Logger LOG = LoggerFactory.getLogger(KMS.class); + static final Logger LOG = LoggerFactory.getLogger(KMS.class); public KMS() throws Exception { provider = KMSWebApp.getKeyProvider(); diff --git a/hadoop-common-project/hadoop-kms/src/main/java/org/apache/hadoop/crypto/key/kms/server/KMSExceptionsProvider.java b/hadoop-common-project/hadoop-kms/src/main/java/org/apache/hadoop/crypto/key/kms/server/KMSExceptionsProvider.java index aa9d2995ab..3d977532df 100644 --- a/hadoop-common-project/hadoop-kms/src/main/java/org/apache/hadoop/crypto/key/kms/server/KMSExceptionsProvider.java +++ b/hadoop-common-project/hadoop-kms/src/main/java/org/apache/hadoop/crypto/key/kms/server/KMSExceptionsProvider.java @@ -43,6 +43,7 @@ public class KMSExceptionsProvider implements ExceptionMapper { private static Logger LOG = LoggerFactory.getLogger(KMSExceptionsProvider.class); + private final static Logger EXCEPTION_LOG = KMS.LOG; private static final String ENTER = System.getProperty("line.separator"); @@ -100,6 +101,9 @@ public Response toResponse(Exception exception) { KMSMDCFilter.getMethod(), KMSMDCFilter.getURL(), getOneLineMessage(exception)); } + EXCEPTION_LOG.warn("User {} request {} {} caused exception.", + KMSMDCFilter.getUgi(), KMSMDCFilter.getMethod(), + KMSMDCFilter.getURL(), exception); return createResponse(status, throwable); }