From 322eeb4aabb44a8bcb3e4b2850fde6c90fc93531 Mon Sep 17 00:00:00 2001 From: Shaun Ford Date: Thu, 6 Jul 2017 15:48:18 -0700 Subject: [PATCH] Add error objects to log statements for cleanup calls --- .../java/com/nike/cerberus/service/CleanUpService.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/nike/cerberus/service/CleanUpService.java b/src/main/java/com/nike/cerberus/service/CleanUpService.java index 5ec57afb5..76fb9b0de 100644 --- a/src/main/java/com/nike/cerberus/service/CleanUpService.java +++ b/src/main/java/com/nike/cerberus/service/CleanUpService.java @@ -94,12 +94,13 @@ protected void cleanUpInactiveAndOrphanedKmsKeys(final int kmsKeysInactiveAfterN TimeUnit.SECONDS.sleep(sleepInSeconds); } catch (InterruptedException ie) { - logger.error("Timeout between KMS key deletion was interrupted"); + logger.error("Timeout between KMS key deletion was interrupted", ie); Thread.currentThread().interrupt(); } catch (Exception e) { logger.error("There was a problem deleting KMS key with id: {}, region: {}", kmsKeyRecord.getAwsIamRoleId(), - kmsKeyRecord.getAwsRegion()); + kmsKeyRecord.getAwsRegion(), + e); } }); } @@ -122,7 +123,8 @@ public void cleanUpOrphanedIamRoles() { awsIamRoleDao.deleteIamRoleById(awsIamRoleRecord.getId()); } catch(Exception e) { logger.error("There was a problem deleting orphaned IAM role with ARN: {}", - awsIamRoleRecord.getAwsIamRoleArn()); + awsIamRoleRecord.getAwsIamRoleArn(), + e); } }); }