Skip to content

Commit 280e5b6

Browse files
authored
Make not-preferred logger naming consistent (#138210)
1 parent 012df24 commit 280e5b6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

server/src/main/java/org/elasticsearch/cluster/routing/allocation/allocator/BalancedShardsAllocator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
public class BalancedShardsAllocator implements ShardsAllocator {
7878

7979
private static final Logger logger = LogManager.getLogger(BalancedShardsAllocator.class);
80-
private static final Logger notPreferredLogger = LogManager.getLogger(BalancedShardsAllocator.class.getName() + ".not-preferred");
80+
private static final Logger notPreferredLogger = LogManager.getLogger(BalancedShardsAllocator.class.getName() + ".not_preferred");
8181

8282
public static final Setting<Float> SHARD_BALANCE_FACTOR_SETTING = Setting.floatSetting(
8383
"cluster.routing.allocation.balance.shard",

server/src/test/java/org/elasticsearch/cluster/routing/allocation/allocator/BalancedShardsAllocatorTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,7 @@ public void testReturnEarlyOnShardAssignmentChanges() {
10081008
}
10091009

10101010
@TestLogging(
1011-
value = "org.elasticsearch.cluster.routing.allocation.allocator.BalancedShardsAllocator.not-preferred:DEBUG",
1011+
value = "org.elasticsearch.cluster.routing.allocation.allocator.BalancedShardsAllocator.not_preferred:DEBUG",
10121012
reason = "debug logging for test"
10131013
)
10141014
public void testNotPreferredMovementIsLoggedAtDebugLevel() {
@@ -1031,7 +1031,7 @@ public Decision canRemain(
10311031
}
10321032
})), clusterState.getRoutingNodes().mutableCopy(), clusterState, ClusterInfo.EMPTY, SnapshotShardSizeInfo.EMPTY, 0L);
10331033

1034-
final var notPreferredLoggerName = BalancedShardsAllocator.class.getName() + ".not-preferred";
1034+
final var notPreferredLoggerName = BalancedShardsAllocator.class.getName() + ".not_preferred";
10351035
MockLog.assertThatLogger(
10361036
() -> balancedShardsAllocator.allocate(allocation),
10371037
notPreferredLoggerName,

0 commit comments

Comments
 (0)