From 7c142d0031792ab9f0a2c8749975224f142572e1 Mon Sep 17 00:00:00 2001 From: Jarkko Jaakola Date: Fri, 3 May 2024 11:48:36 +0300 Subject: [PATCH] fix: add logging to integration tests --- build.gradle.kts | 3 ++- .../resources/log4j.properties | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 src/integrationTest/resources/log4j.properties diff --git a/build.gradle.kts b/build.gradle.kts index 03f466bb..d0ff8326 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -118,7 +118,7 @@ publishing { } val kafkaVersion = "2.2.0" -val slf4jVersion = "1.7.36" +val slf4jVersion = "2.0.13" val avroVersion = "1.8.1" // Version 1.8.1 brings Jackson 1.9.x/org.codehaus.jackson package for Avro and Confluent Platform 4.1.4. @@ -190,6 +190,7 @@ dependencies { integrationTestRuntimeOnly("io.confluent:kafka-avro-serializer:$confluentPlatformVersion") integrationTestRuntimeOnly("io.confluent:kafka-connect-avro-converter:$confluentPlatformVersion") integrationTestRuntimeOnly("io.confluent:kafka-json-serializer:$confluentPlatformVersion") + integrationTestRuntimeOnly("org.slf4j:slf4j-log4j12:$slf4jVersion") integrationTestImplementation("org.apache.kafka:connect-runtime:$kafkaVersion") integrationTestImplementation("com.fasterxml.jackson.core:jackson-annotations:$jacksonVersion") diff --git a/src/integrationTest/resources/log4j.properties b/src/integrationTest/resources/log4j.properties new file mode 100644 index 00000000..30b868ad --- /dev/null +++ b/src/integrationTest/resources/log4j.properties @@ -0,0 +1,20 @@ +## +# Copyright 2024 Aiven Oy +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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=INFO, stdout +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=[%d] %C %p %m (%c:%L)%n +log4j.logger.org.apache.kafka=ERROR \ No newline at end of file