Skip to content

Commit

Permalink
KAFKA-9366: migration to yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
frankvicky committed Nov 20, 2024
1 parent 5e1eaf5 commit a1c2294
Show file tree
Hide file tree
Showing 43 changed files with 1,291 additions and 1,163 deletions.
1 change: 1 addition & 0 deletions LICENSE-binary
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ jackson-annotations-2.16.2
jackson-core-2.16.2
jackson-databind-2.16.2
jackson-dataformat-csv-2.16.2
jackson-dataformat-yaml-2.16.2
jackson-datatype-jdk8-2.16.2
jackson-jaxrs-base-2.16.2
jackson-jaxrs-json-provider-2.16.2
Expand Down
18 changes: 18 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ allprojects {
libs.scalaLibrary,
libs.scalaReflect,
libs.jacksonAnnotations,
libs.jacksonDatabindYaml,
// be explicit about the Netty dependency version instead of relying on the version set by
// ZooKeeper (potentially older and containing CVEs)
libs.nettyHandler,
Expand Down Expand Up @@ -1090,6 +1091,7 @@ project(':core') {
implementation libs.log4j2Core
implementation libs.log4j2Api
implementation libs.log4j1Bridge2Api
implementation libs.jacksonDatabindYaml

testImplementation project(':clients').sourceSets.test.output
testImplementation project(':group-coordinator').sourceSets.test.output
Expand Down Expand Up @@ -1366,6 +1368,7 @@ project(':metadata') {
compileOnly libs.log4j2Api
compileOnly libs.log4j2Core
compileOnly libs.log4j1Bridge2Api
testImplementation libs.jacksonDatabindYaml
testImplementation libs.junitJupiter
testImplementation libs.jqwik
testImplementation libs.mockitoCore
Expand Down Expand Up @@ -1494,6 +1497,7 @@ project(':group-coordinator') {
testImplementation project(':clients').sourceSets.test.output
testImplementation project(':server-common').sourceSets.test.output
testImplementation project(':coordinator-common').sourceSets.test.output
testImplementation libs.jacksonDatabindYaml
testImplementation libs.junitJupiter
testImplementation libs.mockitoCore

Expand Down Expand Up @@ -1556,6 +1560,7 @@ project(':test-common') {
implementation project(':storage')
implementation project(':server-common')
implementation libs.slf4jApi
implementation libs.jacksonDatabindYaml
testImplementation libs.junitJupiter
testImplementation libs.mockitoCore

Expand Down Expand Up @@ -1857,6 +1862,7 @@ project(':clients') {

testImplementation libs.bcpkix
testImplementation libs.jacksonJaxrsJsonProvider
testImplementation libs.jacksonDatabindYaml
testImplementation libs.jose4j
testImplementation libs.junitJupiter
testImplementation libs.log4j2Api
Expand Down Expand Up @@ -2025,11 +2031,13 @@ project(':raft') {
implementation project(':clients')
implementation libs.slf4jApi
implementation libs.jacksonDatabind
implementation libs.jacksonDatabindYaml

testImplementation project(':server-common')
testImplementation project(':server-common').sourceSets.test.output
testImplementation project(':clients')
testImplementation project(':clients').sourceSets.test.output
testImplementation libs.jacksonDatabindYaml
testImplementation libs.junitJupiter
testImplementation libs.mockitoCore
testImplementation libs.jqwik
Expand Down Expand Up @@ -2125,6 +2133,7 @@ project(':server-common') {

testImplementation project(':clients')
testImplementation project(':clients').sourceSets.test.output
testImplementation libs.jacksonDatabindYaml
testImplementation libs.junitJupiter
testImplementation libs.mockitoCore

Expand Down Expand Up @@ -2258,6 +2267,7 @@ project(':storage') {
testImplementation project(':server-common')
testImplementation project(':server-common').sourceSets.test.output
testImplementation libs.hamcrest
testImplementation libs.jacksonDatabindYaml
testImplementation libs.junitJupiter
testImplementation libs.mockitoCore
testImplementation libs.bcpkix
Expand Down Expand Up @@ -2566,6 +2576,7 @@ project(':shell') {
testImplementation project(':core')
testImplementation project(':server-common')
testImplementation project(':server-common').sourceSets.test.output
testImplementation libs.jacksonDatabindYaml
testImplementation libs.junitJupiter

testRuntimeOnly runtimeTestLibs
Expand Down Expand Up @@ -2617,6 +2628,7 @@ project(':streams') {
testImplementation libs.log4j2Api
testImplementation libs.log4j2Core
testImplementation libs.log4j1Bridge2Api
testImplementation libs.jacksonDatabindYaml
testImplementation libs.junitJupiter
testImplementation libs.bcpkix
testImplementation libs.hamcrest
Expand Down Expand Up @@ -2763,6 +2775,7 @@ project(':streams:streams-scala') {
testImplementation project(':clients').sourceSets.test.output
testImplementation project(':streams:test-utils')

testImplementation libs.jacksonDatabindYaml
testImplementation libs.junitJupiter
testImplementation libs.mockitoJunitJupiter // supports MockitoExtension
testRuntimeOnly runtimeTestLibs
Expand Down Expand Up @@ -2819,6 +2832,7 @@ project(':streams:integration-tests') {
testImplementation project(':transaction-coordinator')
testImplementation libs.bcpkix
testImplementation libs.hamcrest
testImplementation libs.jacksonDatabindYaml
testImplementation libs.junitJupiter
testImplementation libs.junitPlatformSuiteEngine // supports suite test
testImplementation libs.mockitoCore
Expand Down Expand Up @@ -2864,6 +2878,7 @@ project(':streams:test-utils') {
implementation libs.slf4jApi

testImplementation project(':clients').sourceSets.test.output
testImplementation libs.jacksonDatabindYaml
testImplementation libs.junitJupiter
testImplementation libs.mockitoCore
testImplementation libs.hamcrest
Expand Down Expand Up @@ -3554,6 +3569,7 @@ project(':connect:runtime') {
testImplementation project(':server-common').sourceSets.test.output
testImplementation project(':test-common:test-common-api')

testImplementation libs.jacksonDatabindYaml
testImplementation libs.junitJupiter
testImplementation libs.mockitoCore
testImplementation libs.mockitoJunitJupiter
Expand Down Expand Up @@ -3659,6 +3675,7 @@ project(':connect:file') {
runtimeOnly libs.log4j2Core
runtimeOnly libs.log4j1Bridge2Api

testImplementation libs.jacksonDatabindYaml
testImplementation libs.junitJupiter
testImplementation libs.mockitoCore

Expand Down Expand Up @@ -3765,6 +3782,7 @@ project(':connect:mirror') {
testImplementation libs.log4j2Core
testImplementation libs.log4j1Bridge2Api
testImplementation libs.bndlib
testImplementation libs.jacksonDatabindYaml
testImplementation libs.mockitoCore
testImplementation project(':clients').sourceSets.test.output
testImplementation project(':connect:runtime').sourceSets.test.output
Expand Down
36 changes: 0 additions & 36 deletions clients/src/test/resources/log4j2.properties

This file was deleted.

38 changes: 38 additions & 0 deletions clients/src/test/resources/log4j2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.

Configuration:
Properties:
Property:
- name: "logPattern"
value: "[%d] %p %m (%c:%L)%n"

Appenders:
Console:
name: STDOUT
PatternLayout:
pattern: "${logPattern}"

Loggers:
Root:
level: OFF
AppenderRef:
- ref: STDOUT
Logger:
- name: org.apache.kafka
level: ERROR
# We are testing for a particular INFO log message in CommonNameLoggingTrustManagerFactoryWrapper
- name: org.apache.kafka.common.security.ssl.CommonNameLoggingTrustManagerFactoryWrapper
level: INFO
39 changes: 0 additions & 39 deletions config/connect-log4j2.properties

This file was deleted.

44 changes: 44 additions & 0 deletions config/connect-log4j2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.

Configuration:
Properties:
Property:
- name: "kafka.logs.dir"
value: "."
- name: "logPattern"
value: "[%d] %p %X{connector.context}%m (%c:%L)%n"

Appenders:
Console:
name: STDOUT
PatternLayout:
pattern: "${logPattern}"

RollingFile:
- name: ConnectAppender
fileName: "${sys:kafka.logs.dir}/connect.log"
filePattern: "${sys:kafka.logs.dir}/connect-%d{yyyy-MM-dd-HH}.log"
PatternLayout:
pattern: "${logPattern}"
TimeBasedTriggeringPolicy:
modulate: true
interval: 1
Loggers:
Root:
level: INFO
AppenderRef:
- ref: STDOUT
- ref: ConnectAppender
Loading

0 comments on commit a1c2294

Please sign in to comment.