Skip to content

Commit

Permalink
1. Add log4j2-appender module. 2. Implement KafkaAppender.
Browse files Browse the repository at this point in the history
  • Loading branch information
dongjinleekr committed Sep 9, 2021
1 parent ebb1d6e commit 5739b46
Show file tree
Hide file tree
Showing 10 changed files with 931 additions and 0 deletions.
22 changes: 22 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -1914,6 +1914,28 @@ project(':log4j-appender') {

}

project(':log4j2-appender') {
archivesBaseName = "kafka-log4j2-appender"

dependencies {
compile project(':clients')
compile libs.log4j2Api
compile libs.log4j2Core
compile libs.slf4jlog4j2

testCompile project(':clients').sourceSets.test.output
testCompile libs.hamcrest
testCompile libs.junitJupiterApi
testCompile libs.junitVintageEngine
testCompile libs.log4j2CoreTest
}

javadoc {
enabled = false
}

}

project(':connect:api') {
archivesBaseName = "connect-api"

Expand Down
7 changes: 7 additions & 0 deletions checkstyle/import-control.xml
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,13 @@
<allow pkg="org.apache.kafka.test" />
</subpackage>

<subpackage name="log4j2appender">
<allow pkg="org.apache.logging.log4j" />
<allow pkg="org.apache.kafka.clients" />
<allow pkg="org.apache.kafka.common" />
<allow pkg="org.apache.kafka.test" />
</subpackage>

<subpackage name="test">
<allow pkg="org.apache.kafka" />
<allow pkg="org.bouncycastle" />
Expand Down
6 changes: 6 additions & 0 deletions checkstyle/suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,12 @@
<suppress checks="JavaNCSS"
files="RequestResponseTest.java"/>

<!-- Log4J2-Appender -->
<suppress checks="CyclomaticComplexity"
files="KafkaAppender.java"/>
<suppress checks="NPathComplexity"
files="KafkaAppender.java"/>

<!-- metadata -->
<suppress checks="ClassDataAbstractionCoupling"
files="(ReplicationControlManager|ReplicationControlManagerTest).java"/>
Expand Down
5 changes: 5 additions & 0 deletions gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ versions += [
jmh: "1.27",
hamcrest: "2.2",
log4j: "1.2.17",
log4j2: "2.13.3",
scalaLogging: "3.9.2",
jaxb: "2.3.0",
jaxrs: "2.1.1",
Expand Down Expand Up @@ -176,6 +177,9 @@ libs += [
kafkaStreams_26: "org.apache.kafka:kafka-streams:$versions.kafka_26",
kafkaStreams_27: "org.apache.kafka:kafka-streams:$versions.kafka_27",
log4j: "log4j:log4j:$versions.log4j",
log4j2Api: "org.apache.logging.log4j:log4j-api:$versions.log4j2",
log4j2Core: "org.apache.logging.log4j:log4j-core:$versions.log4j2",
log4j2CoreTest: "org.apache.logging.log4j:log4j-core:$versions.log4j2:tests",
lz4: "org.lz4:lz4-java:$versions.lz4",
metrics: "com.yammer.metrics:metrics-core:$versions.metrics",
mockitoCore: "org.mockito:mockito-core:$versions.mockito",
Expand All @@ -194,6 +198,7 @@ libs += [
scalatest: "org.scalatest:scalatest_$versions.baseScala:$versions.scalatest",
slf4jApi: "org.slf4j:slf4j-api:$versions.slf4j",
slf4jlog4j: "org.slf4j:slf4j-log4j12:$versions.slf4j",
slf4jlog4j2: "org.apache.logging.log4j:log4j-slf4j-impl:$versions.log4j2",
snappy: "org.xerial.snappy:snappy-java:$versions.snappy",
zookeeper: "org.apache.zookeeper:zookeeper:$versions.zookeeper",
jfreechart: "jfreechart:jfreechart:$versions.jfreechart",
Expand Down
Loading

0 comments on commit 5739b46

Please sign in to comment.