From 81e14c56170abe0c533beba5a96d6372cd8ca8a0 Mon Sep 17 00:00:00 2001 From: Areek Zillur Date: Sun, 15 May 2016 20:45:10 -0400 Subject: [PATCH] Fix license log message levels Now we log license expiry, invalid and grace message as warn and log license valid message as debug closes elastic/elasticsearch#2230 Original commit: elastic/x-pack-elasticsearch@569c1691365d66dd4c3ed3fce18eac88dfe194ab --- .../license/plugin/core/LicensesService.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/elasticsearch/x-pack/license-plugin/src/main/java/org/elasticsearch/license/plugin/core/LicensesService.java b/elasticsearch/x-pack/license-plugin/src/main/java/org/elasticsearch/license/plugin/core/LicensesService.java index fe0be8763b5..1bece25bc6f 100644 --- a/elasticsearch/x-pack/license-plugin/src/main/java/org/elasticsearch/license/plugin/core/LicensesService.java +++ b/elasticsearch/x-pack/license-plugin/src/main/java/org/elasticsearch/license/plugin/core/LicensesService.java @@ -515,7 +515,7 @@ public class LicensesService extends AbstractLifecycleComponent logger.debug("notifying [{}] listeners", registeredLicensees.size()); long now = System.currentTimeMillis(); if (license.issueDate() > now) { - logger.info("license [{}] - invalid", license.uid()); + logger.warn("license [{}] - invalid", license.uid()); return; } long expiryDuration = license.expiryDate() - now; @@ -523,7 +523,7 @@ public class LicensesService extends AbstractLifecycleComponent for (InternalLicensee licensee : registeredLicensees) { licensee.onChange(license, LicenseState.ENABLED); } - logger.info("license [{}] - valid", license.uid()); + logger.debug("license [{}] - valid", license.uid()); final TimeValue delay = TimeValue.timeValueMillis(expiryDuration); // cancel any previous notifications cancelNotifications(expiryNotifications); @@ -537,7 +537,7 @@ public class LicensesService extends AbstractLifecycleComponent for (InternalLicensee licensee : registeredLicensees) { licensee.onChange(license, LicenseState.GRACE_PERIOD); } - logger.info("license [{}] - grace", license.uid()); + logger.warn("license [{}] - grace", license.uid()); final TimeValue delay = TimeValue.timeValueMillis(expiryDuration + gracePeriodDuration.getMillis()); // cancel any previous notifications cancelNotifications(expiryNotifications); @@ -551,7 +551,7 @@ public class LicensesService extends AbstractLifecycleComponent for (InternalLicensee licensee : registeredLicensees) { licensee.onChange(license, LicenseState.DISABLED); } - logger.info("license [{}] - expired", license.uid()); + logger.warn("license [{}] - expired", license.uid()); } if (!license.equals(currentLicense.get())) { currentLicense.set(license);