From 312b8f98b635f3d71102a3a9810bf96d46dbc4da Mon Sep 17 00:00:00 2001 From: piotrsmolinski Date: Tue, 17 Oct 2023 11:38:53 +0200 Subject: [PATCH] Housekeeping changes (#574) * chore: Ignored local maven settings * chore: Unified Jackson dependency * chore: Switched to log4j2 and slf4j2 * chore: Added missing slf4j dependency version * chore: Moved shade plugin after javadoc Shade plugin interferes with the source code, therefore it should be included after all other plugins * chore: Aligned the javadoc source version with compiler source version --- .gitignore | 4 +- pom.xml | 157 +++++++++++++++++----------- src/main/resources/log4j.properties | 5 - src/main/resources/log4j2.yml | 61 ++++------- src/test/resources/log4j2.yml | 57 ++++------ 5 files changed, 134 insertions(+), 150 deletions(-) delete mode 100644 src/main/resources/log4j.properties diff --git a/.gitignore b/.gitignore index 9b1bf6d71..5447b5a74 100644 --- a/.gitignore +++ b/.gitignore @@ -7,11 +7,11 @@ logs/* *.iml _build *~ - dependency-reduced-pom.xml server-api/logs/ example/topology-builder-with-schema-cloud.properties release/ private.key rpm-gen-key -.s3/ \ No newline at end of file +.s3/ +.mvn diff --git a/pom.xml b/pom.xml index 9e702a93b..3a29b2bcc 100644 --- a/pom.xml +++ b/pom.xml @@ -166,53 +166,6 @@ - - org.apache.maven.plugins - maven-shade-plugin - 3.5.0 - - - - *:* - - META-INF/*.SF - META-INF/*.DSA - META-INF/*.RSA - - - - - - - package - - shade - - - - - *:* - - **/Log4j2Plugins.dat - META-INF/*.SF - META-INF/*.DSA - META-INF/*.RSA - - - - - - com.purbon.kafka.topology.CommandLineInterface - - true - - - - - - - - org.apache.maven.plugins maven-compiler-plugin @@ -465,13 +418,60 @@ - 8 + 11 -Xdoclint:none + + org.apache.maven.plugins + maven-shade-plugin + 3.5.0 + + + + *:* + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + + + + + package + + shade + + + + + *:* + + **/Log4j2Plugins.dat + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + + + + com.purbon.kafka.topology.CommandLineInterface + + true + + + + + + + + org.apache.maven.plugins maven-gpg-plugin @@ -562,6 +562,7 @@ 2.20.0 1.18.28 5.5.0 + 2.0.9 1.19.0 1.4.2 3.9.0 @@ -584,11 +585,6 @@ jinjava ${jinjava.version} - - com.fasterxml.jackson.core - jackson-annotations - ${jackson.version} - redis.clients jedis @@ -634,6 +630,10 @@ ch.qos.logback logback-classic + + logback-core + ch.qos.logback + @@ -656,47 +656,57 @@ io.confluent.ksql ksqldb-api-client ${ksqldb.client.version} + + + slf4j-log4j12 + org.slf4j + + org.glassfish.jersey.core jersey-common ${jersey.version} + + + com.fasterxml.jackson.core + jackson-core + + + com.fasterxml.jackson.core + jackson-annotations + com.fasterxml.jackson.core jackson-databind - ${jackson.version} com.fasterxml.jackson.dataformat jackson-dataformat-yaml - ${jackson.version} com.fasterxml.jackson.datatype jackson-datatype-jsr310 - ${jackson.version} com.fasterxml.jackson.datatype jackson-datatype-jdk8 - ${jackson.version} + - com.fasterxml.jackson.core - jackson-core - ${jackson.version} + org.slf4j + slf4j-api org.apache.logging.log4j - log4j-api - ${log4j.version} + log4j-slf4j2-impl org.apache.logging.log4j log4j-core - ${log4j.version} + commons-cli commons-cli @@ -785,6 +795,27 @@ pom import + + org.slf4j + slf4j-api + ${slf4j.version} + pom + import + + + org.apache.logging.log4j + log4j-bom + ${log4j.version} + pom + import + + + com.fasterxml.jackson + jackson-bom + ${jackson.version} + pom + import + diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties deleted file mode 100644 index 709a8b0ea..000000000 --- a/src/main/resources/log4j.properties +++ /dev/null @@ -1,5 +0,0 @@ -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] %p %m (%c)%n diff --git a/src/main/resources/log4j2.yml b/src/main/resources/log4j2.yml index f21cfcd87..14a29525c 100644 --- a/src/main/resources/log4j2.yml +++ b/src/main/resources/log4j2.yml @@ -1,51 +1,30 @@ -Configuration: +configuration: status: warn appenders: - Console: - name: LogToConsole - PatternLayout: - Pattern: "[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n" + console: + name: Console + patternLayout: + Pattern: "[%-5level] %d{HH:mm:ss.SSS} [%t] %c{1} - %msg%n" - #File: - # name: File - # fileName: logs/app.log - # PatternLayout: - # Pattern: "%d %p %C{1.} [%t] %m%n" - - RollingFile: - - name: LogToRollingFile - fileName: logs/app.log - filePattern: "logs/$${date:yyyy-MM}/app-%d{MM-dd-yyyy}-%i.log.gz" - PatternLayout: - pattern: "[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n" - Policies: - SizeBasedTriggeringPolicy: - size: 10MB - DefaultRollOverStrategy: - max: 10 - - Loggers: + loggers: logger: - name: com.purbon.kafka - level: debug - additivity: false - AppenderRef: - - ref: LogToConsole - - ref: LogToRollingFile + level: info - name: com.purbon.kafka.topology level: info - additivity: true - AppenderRef: - - ref: LogToConsole - - ref: LogToRollingFile - name: com.purbon.kafka.topology.api.mds level: info - additivity: true - AppenderRef: - - ref: LogToConsole - - ref: LogToRollingFile - Root: - level: error - AppenderRef: - ref: LogToConsole \ No newline at end of file + - name: org.apache.kafka + level: warn + - name: org.apache.kafka.clients.admin.AdminClientConfig + level: error + - name: org.apache.kafka.clients.producer.ProducerConfig + level: error + - name: org.apache.kafka.clients.consumer.ConsumerConfig + level: error + + root: + level: info + appenderRef: + ref: Console diff --git a/src/test/resources/log4j2.yml b/src/test/resources/log4j2.yml index 12725b5fe..14a29525c 100644 --- a/src/test/resources/log4j2.yml +++ b/src/test/resources/log4j2.yml @@ -1,51 +1,30 @@ -Configuration: +configuration: status: warn appenders: - Console: - name: LogToConsole - PatternLayout: - Pattern: "[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n" + console: + name: Console + patternLayout: + Pattern: "[%-5level] %d{HH:mm:ss.SSS} [%t] %c{1} - %msg%n" - #File: - # name: File - # fileName: logs/app.log - # PatternLayout: - # Pattern: "%d %p %C{1.} [%t] %m%n" - - RollingFile: - - name: LogToRollingFile - fileName: logs/app.log - filePattern: "logs/$${date:yyyy-MM}/app-%d{MM-dd-yyyy}-%i.log.gz" - PatternLayout: - pattern: "[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n" - Policies: - SizeBasedTriggeringPolicy: - size: 10MB - DefaultRollOverStrategy: - max: 10 - - Loggers: + loggers: logger: - name: com.purbon.kafka level: info - additivity: false - AppenderRef: - - ref: LogToConsole - - ref: LogToRollingFile - name: com.purbon.kafka.topology level: info - additivity: true - AppenderRef: - - ref: LogToConsole - - ref: LogToRollingFile - name: com.purbon.kafka.topology.api.mds level: info - additivity: true - AppenderRef: - - ref: LogToConsole - - ref: LogToRollingFile - Root: + - name: org.apache.kafka + level: warn + - name: org.apache.kafka.clients.admin.AdminClientConfig + level: error + - name: org.apache.kafka.clients.producer.ProducerConfig + level: error + - name: org.apache.kafka.clients.consumer.ConsumerConfig + level: error + + root: level: info - AppenderRef: - ref: LogToConsole \ No newline at end of file + appenderRef: + ref: Console