HADOOP-13854. KMS should log error details in KMSExceptionsProvider.

(cherry picked from commit c4b5c32669)
This commit is contained in:
Xiao Chen 2017-06-08 22:35:31 -07:00
parent ffaf24e308
commit aaf533e8a0
2 changed files with 5 additions and 1 deletions

View File

@ -70,7 +70,7 @@ public class KMS {
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();

View File

@ -43,6 +43,7 @@ import java.io.IOException;
public class KMSExceptionsProvider implements ExceptionMapper<Exception> {
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 class KMSExceptionsProvider implements ExceptionMapper<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);
}