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@569c169136
This commit is contained in:
Areek Zillur 2016-05-15 20:45:10 -04:00
parent 946cbfb997
commit 81e14c5617
1 changed files with 4 additions and 4 deletions

View File

@ -515,7 +515,7 @@ public class LicensesService extends AbstractLifecycleComponent<LicensesService>
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<LicensesService>
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<LicensesService>
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<LicensesService>
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);