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
This commit is contained in:
Colin Goodheart-Smithe 2018-05-09 11:40:27 +01:00
parent a03241d590
commit 54d1efd73b
No known key found for this signature in database
GPG Key ID: F975E7BDD739B3C7
3 changed files with 7 additions and 7 deletions

View File

@ -82,7 +82,7 @@ public class ExecuteStepsUpdateTask extends ClusterStateUpdateTask {
currentState = IndexLifecycleRunner.moveClusterStateToNextStep(index, currentState, currentStep.getKey(), currentState = IndexLifecycleRunner.moveClusterStateToNextStep(index, currentState, currentStep.getKey(),
currentStep.getNextStepKey(), nowSupplier); currentStep.getNextStepKey(), nowSupplier);
} else { } else {
logger.warn("condition not met, returning existing state"); logger.debug("condition not met, returning existing state");
return currentState; return currentState;
} }
} }

View File

@ -42,7 +42,7 @@ public class IndexLifecycleRunner {
boolean fromClusterStateChange) { boolean fromClusterStateChange) {
Settings indexSettings = indexMetaData.getSettings(); Settings indexSettings = indexMetaData.getSettings();
Step currentStep = getCurrentStep(stepRegistry, policy, indexSettings); 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) { if (currentStep instanceof TerminalPolicyStep) {
logger.debug("policy [" + policy + "] for index [" + indexMetaData.getIndex().getName() + "] complete, skipping execution"); logger.debug("policy [" + policy + "] for index [" + indexMetaData.getIndex().getName() + "] complete, skipping execution");
} else if (currentStep instanceof ErrorStep) { } else if (currentStep instanceof ErrorStep) {
@ -56,7 +56,7 @@ public class IndexLifecycleRunner {
@Override @Override
public void onResponse(boolean conditionMet) { 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) { if (conditionMet) {
moveToStep(indexMetaData.getIndex(), policy, currentStep.getKey(), currentStep.getNextStepKey()); moveToStep(indexMetaData.getIndex(), policy, currentStep.getKey(), currentStep.getNextStepKey());
} }
@ -75,7 +75,7 @@ public class IndexLifecycleRunner {
@Override @Override
public void onResponse(boolean complete) { 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()) { if (complete && ((AsyncActionStep) currentStep).indexSurvives()) {
moveToStep(indexMetaData.getIndex(), policy, currentStep.getKey(), currentStep.getNextStepKey()); 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) { 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); + nextStepKey);
clusterService.submitStateUpdateTask("ILM", new MoveToNextStepUpdateTask(index, policy, currentStepKey, clusterService.submitStateUpdateTask("ILM", new MoveToNextStepUpdateTask(index, policy, currentStepKey,
nextStepKey, nowSupplier, newState -> runPolicy(newState.getMetaData().index(index), newState))); nextStepKey, nowSupplier, newState -> runPolicy(newState.getMetaData().index(index), newState)));
} }
private void moveToErrorStep(Index index, String policy, StepKey currentStepKey, Exception e) { 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); + "]. Moving to ERROR step.", e);
clusterService.submitStateUpdateTask("ILM", new MoveToErrorStepUpdateTask(index, policy, currentStepKey, nowSupplier)); clusterService.submitStateUpdateTask("ILM", new MoveToErrorStepUpdateTask(index, policy, currentStepKey, nowSupplier));
} }

View File

@ -119,7 +119,7 @@ public class IndexLifecycleService extends AbstractComponent
@Override @Override
public void triggered(SchedulerEngine.Event event) { public void triggered(SchedulerEngine.Event event) {
if (event.getJobName().equals(IndexLifecycle.NAME)) { 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); triggerPolicies(clusterService.state(), false);
} }
} }