Skip to content

Commit 7a9af87

Browse files
Enable Debug Logging for Master and Coordination Packages (#46363) (#46374)
In order to track down #46091: * Enables debug logging in REST tests for `master` and `coordination` packages since we suspect that issues are caused by failed and then retried publications
1 parent 5201386 commit 7a9af87

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java

+4
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,10 @@ private void createConfiguration() {
912912
// Don't wait for state, just start up quickly. This will also allow new and old nodes in the BWC case to become the master
913913
defaultConfig.put("discovery.initial_state_timeout", "0s");
914914

915+
// TODO: Remove these once https://github.com/elastic/elasticsearch/issues/46091 is fixed
916+
defaultConfig.put("logger.org.elasticsearch.action.support.master", "DEBUG");
917+
defaultConfig.put("logger.org.elasticsearch.cluster.coordination", "DEBUG");
918+
915919
HashSet<String> overriden = new HashSet<>(defaultConfig.keySet());
916920
overriden.retainAll(settings.keySet());
917921
overriden.removeAll(OVERRIDABLE_SETTINGS);

server/src/main/java/org/elasticsearch/action/admin/cluster/reroute/TransportClusterRerouteAction.java

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
package org.elasticsearch.action.admin.cluster.reroute;
2121

22+
import org.apache.logging.log4j.LogManager;
2223
import org.apache.logging.log4j.Logger;
2324
import org.apache.logging.log4j.message.ParameterizedMessage;
2425
import org.elasticsearch.ExceptionsHelper;
@@ -58,6 +59,8 @@
5859

5960
public class TransportClusterRerouteAction extends TransportMasterNodeAction<ClusterRerouteRequest, ClusterRerouteResponse> {
6061

62+
private static final Logger logger = LogManager.getLogger(TransportClusterRerouteAction.class);
63+
6164
private final AllocationService allocationService;
6265

6366
@Inject

server/src/main/java/org/elasticsearch/action/support/master/TransportMasterNodeAction.java

+4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
package org.elasticsearch.action.support.master;
2121

22+
import org.apache.logging.log4j.LogManager;
23+
import org.apache.logging.log4j.Logger;
2224
import org.apache.logging.log4j.message.ParameterizedMessage;
2325
import org.elasticsearch.action.ActionListener;
2426
import org.elasticsearch.action.ActionListenerResponseHandler;
@@ -56,6 +58,8 @@
5658
public abstract class TransportMasterNodeAction<Request extends MasterNodeRequest<Request>, Response extends ActionResponse>
5759
extends HandledTransportAction<Request, Response> {
5860

61+
protected static final Logger logger = LogManager.getLogger(TransportMasterNodeAction.class);
62+
5963
protected final ThreadPool threadPool;
6064
protected final TransportService transportService;
6165
protected final ClusterService clusterService;

0 commit comments

Comments
 (0)