Skip to content

Commit

Permalink
fix: log4j properties files (#4293)
Browse files Browse the repository at this point in the history
* fix: log4j properties files

This PR removes the log4j.properties files from our production jars. The presence of such files will make it more tricky for clients to correctly configure log4j with their own properties files as log4j picks the first it finds on the class path by default.

Also, changed many log levels from `ERROR` to `WARN` as important warnings are being excluded, which could be hiding issues.
  • Loading branch information
big-andy-coates authored Jan 14, 2020
1 parent 6b5ce0c commit 5911faf
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 59 deletions.
28 changes: 20 additions & 8 deletions config/log4j-rolling.properties
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,34 @@ log4j.appender.kafka_appender.BrokerList=localhost:9092
log4j.appender.kafka_appender.Topic=default_ksql_processing_log

# loggers

log4j.logger.org.reflections=ERROR, main

# Uncomment the following line to stop KSQL from logging out each request it receives:
#log4j.logger.io.confluent.ksql.rest.server.resources.KsqlResource=WARN

# And this one to avoid the logs being spammed with KsqlConfig values.
# Though these can be useful for debugging / investigations.
#log4j.logger.io.confluent.ksql.util.KsqlConfig=WARN

## KSQL Processing logs:
log4j.logger.processing=WARN, kafka_appender
log4j.additivity.processing=false

## Kafka Streams logs:
log4j.logger.org.apache.kafka.streams=INFO, streams
log4j.additivity.org.apache.kafka.streams=false

log4j.logger.kafka=ERROR, kafka
## Kafka client logs:
log4j.logger.kafka=WARN, kafka
log4j.additivity.kafka=false

log4j.logger.org.apache.zookeeper=ERROR, kafka
log4j.logger.org.apache.zookeeper=WARN, kafka
log4j.additivity.org.apache.zookeeper=false

log4j.logger.org.apache.kafka=ERROR, kafka
log4j.logger.org.apache.kafka=WARN, kafka
log4j.additivity.org.apache.kafka=false

log4j.logger.org.I0Itec.zkclient=ERROR, kafka
log4j.logger.org.I0Itec.zkclient=WARN, kafka
log4j.additivity.org.I0Itec.zkclient=false

log4j.logger.processing=ERROR, kafka_appender
log4j.additivity.processing=false

log4j.logger.org.reflections=ERROR, main
25 changes: 18 additions & 7 deletions config/log4j.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

log4j.rootLogger=INFO, stdout

# appenders
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
Expand All @@ -23,13 +24,23 @@ log4j.appender.streams=org.apache.log4j.ConsoleAppender
log4j.appender.streams.layout=org.apache.log4j.PatternLayout
log4j.appender.streams.layout.ConversionPattern=[%d] %p %m (%c:%L)%n

log4j.logger.kafka=ERROR, stdout
log4j.logger.org.apache.kafka.streams=INFO, streams
log4j.additivity.org.apache.kafka.streams=false
log4j.logger.org.apache.zookeeper=ERROR, stdout
log4j.logger.org.apache.kafka=ERROR, stdout
log4j.logger.org.I0Itec.zkclient=ERROR, stdout
# loggers

log4j.logger.org.reflections=ERROR, stdout

# Uncomment the following line to stop KSQL from logging out each request it receives:
#log4j.logger.io.confluent.ksql.rest.server.resources.KsqlResource=WARN, stdout
#log4j.logger.io.confluent.ksql.rest.server.resources.KsqlResource=WARN

# And this one to avoid the logs being spammed with KsqlConfig values.
# Though these can be useful for debugging / investigations.
#log4j.logger.io.confluent.ksql.util.KsqlConfig=WARN

## Kafka Streams logs:
log4j.logger.org.apache.kafka.streams=INFO, streams
log4j.additivity.org.apache.kafka.streams=false

## Kafka Client logs:
log4j.logger.kafka=WARN, stdout
log4j.logger.org.apache.zookeeper=WARN, stdout
log4j.logger.org.apache.kafka=WARN, stdout
log4j.logger.org.I0Itec.zkclient=WARN, stdout
22 changes: 0 additions & 22 deletions ksql-engine/src/main/resources/log4j.properties

This file was deleted.

22 changes: 0 additions & 22 deletions ksql-rest-app/src/main/resources/log4j.properties

This file was deleted.

0 comments on commit 5911faf

Please sign in to comment.