You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/02/10 15:49:27 UTC

[GitHub] [kafka] mimaison commented on a change in pull request #7898: KAFKA-9366: Change log4j dependency into log4j2

mimaison commented on a change in pull request #7898:
URL: https://github.com/apache/kafka/pull/7898#discussion_r797627738



##########
File path: clients/src/test/resources/log4j2.properties
##########
@@ -12,11 +12,16 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-log4j.rootLogger=OFF, stdout
+name=TestConfig
+appenders = console
 
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c:%L)%n
+appender.console.type=Console
+appender.console.name=STDOUT
+appender.console.layout.type=PatternLayout
+appender.console.layout.pattern=[%d] %p %m (%c:%L)%n
 
-log4j.logger.org.apache.kafka.raft=ERROR
-log4j.logger.org.apache.kafka.snapshot=ERROR
+rootLogger.level = off
+rootLogger.appenderRefs = stdout
+rootLogger.appenderRef.stdout.ref = STDOUT
+
+status = error

Review comment:
       nit: Can we get rid of the extra spaces and have `name=value` for all these lines like in the other files?

##########
File path: bin/kafka-server-start.sh
##########
@@ -22,6 +22,7 @@ fi
 base_dir=$(dirname $0)
 
 if [ "x$KAFKA_LOG4J_OPTS" = "x" ]; then
+    echo "DEPRECATED: using log4j 1.x configuration. To use log4j 2.x configuration, run with: 'export KAFKA_LOG4J_OPTS=\"-Dlog4j.configurationFile=file:$base_dir/../config/log4j2.properties\"'"

Review comment:
       Is the plan to remove this and use the log4j2 file by default in the next major release?

##########
File path: streams/src/test/java/org/apache/kafka/streams/KafkaStreamsTest.java
##########
@@ -522,8 +522,8 @@ public void testStateGlobalThreadClose() throws Exception {
         final StreamsBuilder builder = getBuilderWithSource();
         builder.globalTable("anyTopic");
 
-        try (final LogCaptureAppender appender = LogCaptureAppender.createAndRegister(KafkaStreams.class);
-            final KafkaStreams streams = new KafkaStreams(builder.build(), props, supplier, time)) {
+        try (final LogCaptureContext logCaptureContext = LogCaptureContext.create();
+             final KafkaStreams streams = new KafkaStreams(builder.build(), props, supplier, time)) {

Review comment:
       nit: this is not aligned




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org