Skip to content

Commit f6e9bbf

Browse files
authored
Remove COMMON_PREFIX from MockLogAppender (#96331)
So that logger names go through as they are in MockLogAppender.
1 parent 1762733 commit f6e9bbf

File tree

3 files changed

+1
-15
lines changed

3 files changed

+1
-15
lines changed

test/framework/src/main/java/org/elasticsearch/test/InternalTestCluster.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,6 @@ public InternalTestCluster(
386386
if (Strings.hasLength(System.getProperty("tests.es.logger.level"))) {
387387
builder.put("logger.level", System.getProperty("tests.es.logger.level"));
388388
}
389-
if (Strings.hasLength(System.getProperty("es.logger.prefix"))) {
390-
builder.put("logger.prefix", System.getProperty("es.logger.prefix"));
391-
}
392389
// Default the watermarks to absurdly low to prevent the tests
393390
// from failing on nodes without enough disk space
394391
builder.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK_SETTING.getKey(), "1b");

test/framework/src/main/java/org/elasticsearch/test/MockLogAppender.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
*/
3434
public class MockLogAppender extends AbstractAppender {
3535

36-
private static final String COMMON_PREFIX = System.getProperty("es.logger.prefix", "org.elasticsearch.");
37-
3836
private final List<WrappedLoggingExpectation> expectations;
3937

4038
public MockLogAppender() {
@@ -79,7 +77,7 @@ public abstract static class AbstractEventExpectation implements LoggingExpectat
7977

8078
public AbstractEventExpectation(String name, String logger, Level level, String message) {
8179
this.name = name;
82-
this.logger = getLoggerName(logger);
80+
this.logger = logger;
8381
this.level = level;
8482
this.message = message;
8583
this.saw = false;
@@ -210,13 +208,6 @@ public void assertMatched() {
210208

211209
}
212210

213-
private static String getLoggerName(String name) {
214-
if (name.startsWith("org.elasticsearch.")) {
215-
name = name.substring("org.elasticsearch.".length());
216-
}
217-
return COMMON_PREFIX + name;
218-
}
219-
220211
/**
221212
* A wrapper around {@link LoggingExpectation} to detect if the assertMatched method has been called
222213
*/

x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/bench/WatcherScheduleEngineBenchmark.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ public class WatcherScheduleEngineBenchmark {
6868
.build();
6969

7070
public static void main(String[] args) throws Exception {
71-
System.setProperty("es.logger.prefix", "");
72-
7371
String[] engines = new String[] { "ticker", "scheduler" };
7472
int numWatches = 2000;
7573
int benchTime = 60000;

0 commit comments

Comments
 (0)