diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportCloseJobAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportCloseJobAction.java index bd3f2d205d3..c79ee507bd9 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportCloseJobAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportCloseJobAction.java @@ -5,6 +5,8 @@ */ package org.elasticsearch.xpack.ml.action; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ResourceNotFoundException; import org.elasticsearch.action.ActionListener; @@ -50,6 +52,8 @@ import java.util.stream.Collectors; public class TransportCloseJobAction extends TransportTasksAction { + private static final Logger logger = LogManager.getLogger(TransportCloseJobAction.class); + private final ThreadPool threadPool; private final Client client; private final ClusterService clusterService; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportDeleteDataFrameAnalyticsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportDeleteDataFrameAnalyticsAction.java index 74497e5e060..3edefe50537 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportDeleteDataFrameAnalyticsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportDeleteDataFrameAnalyticsAction.java @@ -65,7 +65,7 @@ import static org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin; public class TransportDeleteDataFrameAnalyticsAction extends TransportMasterNodeAction { - private static final Logger LOGGER = LogManager.getLogger(TransportDeleteDataFrameAnalyticsAction.class); + private static final Logger logger = LogManager.getLogger(TransportDeleteDataFrameAnalyticsAction.class); private final Client client; private final MlMemoryTracker memoryTracker; @@ -124,13 +124,13 @@ public class TransportDeleteDataFrameAnalyticsAction ActionListener deleteStateHandler = ActionListener.wrap( bulkByScrollResponse -> { if (bulkByScrollResponse.isTimedOut()) { - LOGGER.warn("[{}] DeleteByQuery for state timed out", id); + logger.warn("[{}] DeleteByQuery for state timed out", id); } if (bulkByScrollResponse.getBulkFailures().isEmpty() == false) { - LOGGER.warn("[{}] {} failures and {} conflicts encountered while runnint DeleteByQuery for state", id, + logger.warn("[{}] {} failures and {} conflicts encountered while runnint DeleteByQuery for state", id, bulkByScrollResponse.getBulkFailures().size(), bulkByScrollResponse.getVersionConflicts()); for (BulkItemResponse.Failure failure : bulkByScrollResponse.getBulkFailures()) { - LOGGER.warn("[{}] DBQ failure: {}", id, failure); + logger.warn("[{}] DBQ failure: {}", id, failure); } } deleteConfig(parentTaskClient, id, listener); @@ -159,7 +159,7 @@ public class TransportDeleteDataFrameAnalyticsAction return; } assert deleteResponse.getResult() == DocWriteResponse.Result.DELETED; - LOGGER.info("[{}] Deleted", id); + logger.info("[{}] Deleted", id); auditor.info(id, Messages.DATA_FRAME_ANALYTICS_AUDIT_DELETED); listener.onResponse(new AcknowledgedResponse(true)); }, diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportDeleteExpiredDataAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportDeleteExpiredDataAction.java index c799d57d74f..bc4bb6e16e5 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportDeleteExpiredDataAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportDeleteExpiredDataAction.java @@ -5,6 +5,8 @@ */ package org.elasticsearch.xpack.ml.action; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.HandledTransportAction; @@ -37,6 +39,8 @@ import java.util.function.Supplier; public class TransportDeleteExpiredDataAction extends HandledTransportAction { + private static final Logger logger = LogManager.getLogger(TransportDeleteExpiredDataAction.class); + // TODO: make configurable in the request static final Duration MAX_DURATION = Duration.ofHours(8); diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportDeleteForecastAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportDeleteForecastAction.java index 1e5659bd233..3b5f0b16e2d 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportDeleteForecastAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportDeleteForecastAction.java @@ -5,6 +5,8 @@ */ package org.elasticsearch.xpack.ml.action; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.ResourceNotFoundException; @@ -66,6 +68,8 @@ import static org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin; public class TransportDeleteForecastAction extends HandledTransportAction { + private static final Logger logger = LogManager.getLogger(TransportDeleteForecastAction.class); + private final Client client; private static final int MAX_FORECAST_TO_SEARCH = 10_000; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportDeleteModelSnapshotAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportDeleteModelSnapshotAction.java index 8071adc34a0..97a6c9c8a78 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportDeleteModelSnapshotAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportDeleteModelSnapshotAction.java @@ -5,6 +5,8 @@ */ package org.elasticsearch.xpack.ml.action; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.elasticsearch.ResourceNotFoundException; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.ActionFilters; @@ -29,6 +31,8 @@ import java.util.List; public class TransportDeleteModelSnapshotAction extends HandledTransportAction { + private static final Logger logger = LogManager.getLogger(TransportDeleteModelSnapshotAction.class); + private final Client client; private final JobManager jobManager; private final JobResultsProvider jobResultsProvider; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportDeleteTrainedModelAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportDeleteTrainedModelAction.java index 47a9fdd32ad..6e78e53e93d 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportDeleteTrainedModelAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportDeleteTrainedModelAction.java @@ -46,7 +46,7 @@ import java.util.Set; public class TransportDeleteTrainedModelAction extends TransportMasterNodeAction { - private static final Logger LOGGER = LogManager.getLogger(TransportDeleteTrainedModelAction.class); + private static final Logger logger = LogManager.getLogger(TransportDeleteTrainedModelAction.class); private final TrainedModelProvider trainedModelProvider; private final InferenceAuditor auditor; @@ -118,7 +118,7 @@ public class TransportDeleteTrainedModelAction .map(InferenceProcessor::getModelId) .forEach(allReferencedModelKeys::add); } catch (Exception ex) { - LOGGER.warn(new ParameterizedMessage("failed to load pipeline [{}]", pipelineId), ex); + logger.warn(new ParameterizedMessage("failed to load pipeline [{}]", pipelineId), ex); } } return allReferencedModelKeys; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetDataFrameAnalyticsStatsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetDataFrameAnalyticsStatsAction.java index 11bdeb33c8b..aadd6041ae6 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetDataFrameAnalyticsStatsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetDataFrameAnalyticsStatsAction.java @@ -65,7 +65,7 @@ public class TransportGetDataFrameAnalyticsStatsAction extends TransportTasksAction> { - private static final Logger LOGGER = LogManager.getLogger(TransportGetDataFrameAnalyticsStatsAction.class); + private static final Logger logger = LogManager.getLogger(TransportGetDataFrameAnalyticsStatsAction.class); private final Client client; @@ -95,7 +95,7 @@ public class TransportGetDataFrameAnalyticsStatsAction @Override protected void taskOperation(GetDataFrameAnalyticsStatsAction.Request request, DataFrameAnalyticsTask task, ActionListener> listener) { - LOGGER.debug("Get stats for running task [{}]", task.getParams().getId()); + logger.debug("Get stats for running task [{}]", task.getParams().getId()); ActionListener> progressListener = ActionListener.wrap( progress -> { @@ -118,7 +118,7 @@ public class TransportGetDataFrameAnalyticsStatsAction @Override protected void doExecute(Task task, GetDataFrameAnalyticsStatsAction.Request request, ActionListener listener) { - LOGGER.debug("Get stats for data frame analytics [{}]", request.getId()); + logger.debug("Get stats for data frame analytics [{}]", request.getId()); ActionListener getResponseListener = ActionListener.wrap( getResponse -> { @@ -221,7 +221,7 @@ public class TransportGetDataFrameAnalyticsStatsAction StoredProgress storedProgress = StoredProgress.PARSER.apply(parser, null); return storedProgress; } catch (IOException e) { - LOGGER.error(new ParameterizedMessage("failed to parse progress from doc with it [{}]", hit.getId()), e); + logger.error(new ParameterizedMessage("failed to parse progress from doc with it [{}]", hit.getId()), e); return new StoredProgress(Collections.emptyList()); } } diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetJobsStatsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetJobsStatsAction.java index 2ad70e996b5..d11abcba7e5 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetJobsStatsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetJobsStatsAction.java @@ -5,6 +5,8 @@ */ package org.elasticsearch.xpack.ml.action; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.FailedNodeException; import org.elasticsearch.action.TaskOperationFailure; @@ -50,6 +52,8 @@ import java.util.stream.Collectors; public class TransportGetJobsStatsAction extends TransportTasksAction> { + private static final Logger logger = LogManager.getLogger(TransportGetJobsStatsAction.class); + private final ClusterService clusterService; private final AutodetectProcessManager processManager; private final JobResultsProvider jobResultsProvider; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetModelSnapshotsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetModelSnapshotsAction.java index 007bdf3c374..43a42501bd0 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetModelSnapshotsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetModelSnapshotsAction.java @@ -5,6 +5,8 @@ */ package org.elasticsearch.xpack.ml.action; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.HandledTransportAction; @@ -22,6 +24,8 @@ import java.util.stream.Collectors; public class TransportGetModelSnapshotsAction extends HandledTransportAction { + private static final Logger logger = LogManager.getLogger(TransportGetModelSnapshotsAction.class); + private final JobResultsProvider jobResultsProvider; private final JobManager jobManager; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetOverallBucketsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetOverallBucketsAction.java index 8ac9390f806..f6c972bfff3 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetOverallBucketsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetOverallBucketsAction.java @@ -5,6 +5,8 @@ */ package org.elasticsearch.xpack.ml.action; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchResponse; @@ -54,6 +56,8 @@ import static org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin; public class TransportGetOverallBucketsAction extends HandledTransportAction { + private static final Logger logger = LogManager.getLogger(TransportGetOverallBucketsAction.class); + private static final String EARLIEST_TIME = "earliest_time"; private static final String LATEST_TIME = "latest_time"; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportKillProcessAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportKillProcessAction.java index 33cd31256fe..90719764e94 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportKillProcessAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportKillProcessAction.java @@ -5,6 +5,8 @@ */ package org.elasticsearch.xpack.ml.action; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.cluster.node.DiscoveryNode; @@ -24,6 +26,8 @@ import org.elasticsearch.xpack.ml.notifications.AnomalyDetectionAuditor; public class TransportKillProcessAction extends TransportJobTaskAction { + private static final Logger logger = LogManager.getLogger(TransportKillProcessAction.class); + private final AnomalyDetectionAuditor auditor; @Inject diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportMlInfoAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportMlInfoAction.java index 07e57d445d6..d1d828de1f2 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportMlInfoAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportMlInfoAction.java @@ -5,6 +5,8 @@ */ package org.elasticsearch.xpack.ml.action; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.HandledTransportAction; @@ -34,6 +36,8 @@ import java.util.concurrent.TimeoutException; public class TransportMlInfoAction extends HandledTransportAction { + private static final Logger logger = LogManager.getLogger(TransportMlInfoAction.class); + private final ClusterService clusterService; private final NamedXContentRegistry xContentRegistry; private final Map nativeCodeInfo; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportStartDataFrameAnalyticsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportStartDataFrameAnalyticsAction.java index 8e0b291e5f5..ee7f096ed69 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportStartDataFrameAnalyticsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportStartDataFrameAnalyticsAction.java @@ -92,7 +92,7 @@ import static org.elasticsearch.xpack.ml.MachineLearning.MAX_OPEN_JOBS_PER_NODE; public class TransportStartDataFrameAnalyticsAction extends TransportMasterNodeAction { - private static final Logger LOGGER = LogManager.getLogger(TransportStartDataFrameAnalyticsAction.class); + private static final Logger logger = LogManager.getLogger(TransportStartDataFrameAnalyticsAction.class); private final XPackLicenseState licenseState; private final Client client; @@ -253,7 +253,7 @@ public class TransportStartDataFrameAnalyticsAction toValidateMappingsListener.onResponse(startContext); break; case FINISHED: - LOGGER.info("[{}] Job has already finished", startContext.config.getId()); + logger.info("[{}] Job has already finished", startContext.config.getId()); finalListener.onFailure(ExceptionsHelper.badRequestException( "Cannot start because the job has already finished")); break; @@ -477,7 +477,7 @@ public class TransportStartDataFrameAnalyticsAction @Override public void onFailure(Exception e) { - LOGGER.error("[" + persistentTask.getParams().getId() + "] Failed to cancel persistent task that could " + + logger.error("[" + persistentTask.getParams().getId() + "] Failed to cancel persistent task that could " + "not be assigned due to [" + exception.getMessage() + "]", e); listener.onFailure(exception); } @@ -553,7 +553,7 @@ public class TransportStartDataFrameAnalyticsAction if (unavailableIndices.size() != 0) { String reason = "Not opening data frame analytics job [" + id + "], because not all primary shards are active for the following indices [" + String.join(",", unavailableIndices) + "]"; - LOGGER.debug(reason); + logger.debug(reason); return new PersistentTasksCustomMetaData.Assignment(null, reason); } @@ -563,7 +563,7 @@ public class TransportStartDataFrameAnalyticsAction if (scheduledRefresh) { String reason = "Not opening data frame analytics job [" + id + "] because job memory requirements are stale - refresh requested"; - LOGGER.debug(reason); + logger.debug(reason); return new PersistentTasksCustomMetaData.Assignment(null, reason); } } @@ -579,7 +579,7 @@ public class TransportStartDataFrameAnalyticsAction @Override protected void nodeOperation(AllocatedPersistentTask task, StartDataFrameAnalyticsAction.TaskParams params, PersistentTaskState state) { - LOGGER.info("[{}] Starting data frame analytics", params.getId()); + logger.info("[{}] Starting data frame analytics", params.getId()); DataFrameAnalyticsTaskState analyticsTaskState = (DataFrameAnalyticsTaskState) state; // If we are "stopping" there is nothing to do diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportStopDatafeedAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportStopDatafeedAction.java index ba197ea0e54..d90f175e46b 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportStopDatafeedAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportStopDatafeedAction.java @@ -5,6 +5,8 @@ */ package org.elasticsearch.xpack.ml.action; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ResourceNotFoundException; import org.elasticsearch.action.ActionListener; @@ -45,6 +47,8 @@ import java.util.stream.Stream; public class TransportStopDatafeedAction extends TransportTasksAction { + private static final Logger logger = LogManager.getLogger(TransportStopDatafeedAction.class); + private final ThreadPool threadPool; private final PersistentTasksService persistentTasksService; private final DatafeedConfigProvider datafeedConfigProvider; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportUpdateModelSnapshotAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportUpdateModelSnapshotAction.java index 986b5426cef..186fba1e003 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportUpdateModelSnapshotAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportUpdateModelSnapshotAction.java @@ -5,6 +5,8 @@ */ package org.elasticsearch.xpack.ml.action; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.elasticsearch.ResourceNotFoundException; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.bulk.BulkAction; @@ -36,6 +38,8 @@ import static org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin; public class TransportUpdateModelSnapshotAction extends HandledTransportAction { + private static final Logger logger = LogManager.getLogger(TransportUpdateModelSnapshotAction.class); + private final JobResultsProvider jobResultsProvider; private final Client client;