Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions checkstyle/import-control-core.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE import-control PUBLIC
"-//Puppy Crawl//DTD Import Control 1.1//EN"
"http://www.puppycrawl.com/dtds/import_control_1_1.dtd">
"-//Checkstyle//DTD ImportControl Configuration 1.4//EN"
"https://checkstyle.sourceforge.io/dtds/import_control_1_4.dtd">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -160,8 +160,10 @@
</subpackage>

<subpackage name="utils">
<allow pkg="org.apache.logging.log4j" />
<allow pkg="org.apache.logging.log4j.core.config" />
<file name="LoggingController.scala">
<allow pkg="org.apache.logging.log4j" />
<allow pkg="org.apache.logging.log4j.core.config" />
</file>
</subpackage>

<subpackage name="clients">
Expand Down
10 changes: 6 additions & 4 deletions checkstyle/import-control.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE import-control PUBLIC
"-//Puppy Crawl//DTD Import Control 1.1//EN"
"http://www.puppycrawl.com/dtds/import_control_1_1.dtd">
"-//Checkstyle//DTD ImportControl Configuration 1.4//EN"
"https://checkstyle.sourceforge.io/dtds/import_control_1_4.dtd">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -581,7 +581,10 @@
<allow pkg="javax.crypto"/>
<allow pkg="org.apache.maven.artifact.versioning" />
<allow pkg="org.eclipse.jetty.util" />
<allow pkg="org.apache.logging.log4j" />

<file name="(Mock)?Loggers(Test)?" regex="true">
<allow pkg="org.apache.logging.log4j" />
</file>

<subpackage name="rest">
<allow pkg="org.eclipse.jetty" />
Expand All @@ -593,7 +596,6 @@
<allow pkg="com.fasterxml.jackson" />
<allow pkg="org.apache.http"/>
<allow pkg="io.swagger.v3.oas.annotations"/>
<allow pkg="org.apache.logging.log4j" />
</subpackage>

<subpackage name="isolation">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
import org.apache.kafka.connect.util.Stage;
import org.apache.kafka.connect.util.TemporaryStage;

import org.apache.logging.log4j.Level;
import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
import org.apache.maven.artifact.versioning.VersionRange;
import org.slf4j.Logger;
Expand Down Expand Up @@ -164,7 +163,7 @@ public AbstractHerder(Worker worker,
this.connectorClientConfigOverridePolicy = connectorClientConfigOverridePolicy;
this.connectorExecutor = Executors.newCachedThreadPool();
this.time = time;
this.loggers = new Loggers(time);
this.loggers = Loggers.newInstance(time);
this.cachedConnectors = new CachedConnectors(worker.getPlugins());
}

Expand Down Expand Up @@ -1261,13 +1260,13 @@ public Map<String, LoggerLevel> allLoggerLevels() {

@Override
public List<String> setWorkerLoggerLevel(String namespace, String desiredLevelStr) {
Level level = Level.toLevel(desiredLevelStr.toUpperCase(Locale.ROOT), null);
String normalizedLevel = desiredLevelStr.toUpperCase(Locale.ROOT);

if (level == null) {
if (!loggers.isValidLevel(normalizedLevel)) {
log.warn("Ignoring request to set invalid level '{}' for namespace {}", desiredLevelStr, namespace);
return Collections.emptyList();
}

return loggers.setLevel(namespace, level);
return loggers.setLevel(namespace, normalizedLevel);
}
}
Loading