From 54d1efd73bb7440fe4bea9f8a9da6d6347e8d210 Mon Sep 17 00:00:00 2001 From: Colin Goodheart-Smithe Date: Wed, 9 May 2018 11:40:27 +0100 Subject: [PATCH] Adjusts logging levels to be more realistic Makes most logging at debug rather than warn and error. x-pack/plugin/index-lifecycle/src/main/java/org/elasticsearch/xpack/inde xlifecycle/ExecuteStepsUpdateTask.java x-pack/plugin/index-lifecycle/src/main/java/org/elasticsearch/xpack/inde xlifecycle/IndexLifecycleRunner.java x-pack/plugin/index-lifecycle/src/main/java/org/elasticsearch/xpack/inde xlifecycle/IndexLifecycleService.java --- .../xpack/indexlifecycle/ExecuteStepsUpdateTask.java | 2 +- .../xpack/indexlifecycle/IndexLifecycleRunner.java | 10 +++++----- .../xpack/indexlifecycle/IndexLifecycleService.java | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/x-pack/plugin/index-lifecycle/src/main/java/org/elasticsearch/xpack/indexlifecycle/ExecuteStepsUpdateTask.java b/x-pack/plugin/index-lifecycle/src/main/java/org/elasticsearch/xpack/indexlifecycle/ExecuteStepsUpdateTask.java index c50dbd6f17c..cb548120b35 100644 --- a/x-pack/plugin/index-lifecycle/src/main/java/org/elasticsearch/xpack/indexlifecycle/ExecuteStepsUpdateTask.java +++ b/x-pack/plugin/index-lifecycle/src/main/java/org/elasticsearch/xpack/indexlifecycle/ExecuteStepsUpdateTask.java @@ -82,7 +82,7 @@ public class ExecuteStepsUpdateTask extends ClusterStateUpdateTask { currentState = IndexLifecycleRunner.moveClusterStateToNextStep(index, currentState, currentStep.getKey(), currentStep.getNextStepKey(), nowSupplier); } else { - logger.warn("condition not met, returning existing state"); + logger.debug("condition not met, returning existing state"); return currentState; } } diff --git a/x-pack/plugin/index-lifecycle/src/main/java/org/elasticsearch/xpack/indexlifecycle/IndexLifecycleRunner.java b/x-pack/plugin/index-lifecycle/src/main/java/org/elasticsearch/xpack/indexlifecycle/IndexLifecycleRunner.java index ce96f7c7a80..b68ebead104 100644 --- a/x-pack/plugin/index-lifecycle/src/main/java/org/elasticsearch/xpack/indexlifecycle/IndexLifecycleRunner.java +++ b/x-pack/plugin/index-lifecycle/src/main/java/org/elasticsearch/xpack/indexlifecycle/IndexLifecycleRunner.java @@ -42,7 +42,7 @@ public class IndexLifecycleRunner { boolean fromClusterStateChange) { Settings indexSettings = indexMetaData.getSettings(); Step currentStep = getCurrentStep(stepRegistry, policy, indexSettings); - logger.warn("running policy with current-step[" + currentStep.getKey() + "]"); + logger.debug("running policy with current-step[" + currentStep.getKey() + "]"); if (currentStep instanceof TerminalPolicyStep) { logger.debug("policy [" + policy + "] for index [" + indexMetaData.getIndex().getName() + "] complete, skipping execution"); } else if (currentStep instanceof ErrorStep) { @@ -56,7 +56,7 @@ public class IndexLifecycleRunner { @Override public void onResponse(boolean conditionMet) { - logger.error("cs-change-async-wait-callback. current-step:" + currentStep.getKey()); + logger.debug("cs-change-async-wait-callback. current-step:" + currentStep.getKey()); if (conditionMet) { moveToStep(indexMetaData.getIndex(), policy, currentStep.getKey(), currentStep.getNextStepKey()); } @@ -75,7 +75,7 @@ public class IndexLifecycleRunner { @Override public void onResponse(boolean complete) { - logger.error("cs-change-async-action-callback. current-step:" + currentStep.getKey()); + logger.debug("cs-change-async-action-callback. current-step:" + currentStep.getKey()); if (complete && ((AsyncActionStep) currentStep).indexSurvives()) { moveToStep(indexMetaData.getIndex(), policy, currentStep.getKey(), currentStep.getNextStepKey()); } @@ -178,14 +178,14 @@ public class IndexLifecycleRunner { } private void moveToStep(Index index, String policy, StepKey currentStepKey, StepKey nextStepKey) { - logger.error("moveToStep[" + policy + "] [" + index.getName() + "]" + currentStepKey + " -> " + logger.debug("moveToStep[" + policy + "] [" + index.getName() + "]" + currentStepKey + " -> " + nextStepKey); clusterService.submitStateUpdateTask("ILM", new MoveToNextStepUpdateTask(index, policy, currentStepKey, nextStepKey, nowSupplier, newState -> runPolicy(newState.getMetaData().index(index), newState))); } private void moveToErrorStep(Index index, String policy, StepKey currentStepKey, Exception e) { - logger.error("policy [" + policy + "] for index [" + index.getName() + "] failed on step [" + currentStepKey + logger.debug("policy [" + policy + "] for index [" + index.getName() + "] failed on step [" + currentStepKey + "]. Moving to ERROR step.", e); clusterService.submitStateUpdateTask("ILM", new MoveToErrorStepUpdateTask(index, policy, currentStepKey, nowSupplier)); } diff --git a/x-pack/plugin/index-lifecycle/src/main/java/org/elasticsearch/xpack/indexlifecycle/IndexLifecycleService.java b/x-pack/plugin/index-lifecycle/src/main/java/org/elasticsearch/xpack/indexlifecycle/IndexLifecycleService.java index 8ba68e0e6ee..4ade4dc0222 100644 --- a/x-pack/plugin/index-lifecycle/src/main/java/org/elasticsearch/xpack/indexlifecycle/IndexLifecycleService.java +++ b/x-pack/plugin/index-lifecycle/src/main/java/org/elasticsearch/xpack/indexlifecycle/IndexLifecycleService.java @@ -119,7 +119,7 @@ public class IndexLifecycleService extends AbstractComponent @Override public void triggered(SchedulerEngine.Event event) { if (event.getJobName().equals(IndexLifecycle.NAME)) { - logger.info("Job triggered: " + event.getJobName() + ", " + event.getScheduledTime() + ", " + event.getTriggeredTime()); + logger.debug("Job triggered: " + event.getJobName() + ", " + event.getScheduledTime() + ", " + event.getTriggeredTime()); triggerPolicies(clusterService.state(), false); } }