Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,9 @@ project(":samza-test_$scalaSuffix") {
compile.exclude group: 'javax.jms', module: 'jms'
compile.exclude group: 'com.sun.jdmk', module: 'jmxtools'
compile.exclude group: 'com.sun.jmx', module: 'jmxri'
// Exclude Slf4j bindings for log4j1 and log4j2 since samza-test just logs to console using slf4j-simple
compile.exclude group: 'org.slf4j', module: 'slf4j-log4j12'
compile.exclude group: 'org.apache.logging.log4j', module: 'log4j-slf4j-impl'
}

dependencies {
Expand All @@ -819,8 +822,6 @@ project(":samza-test_$scalaSuffix") {
compile project(":samza-core_$scalaSuffix")
compile project(":samza-kafka_$scalaSuffix")
compile project(":samza-sql_$scalaSuffix")
runtime project(":samza-log4j_$scalaSuffix")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to exclude the slf4j-log4j12 (log4j1 binding) and slf4j-log4j-impl (log4j2 binding) from the dependencies? At least log4j1 binding currently comes transitively from several of the modules. If SLF4J picks it up and it finds that the log4j.xml is missing, it might not log to console.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, it'll log to stdout, but thats still not desirable

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rmatharu Actually logging to stdout is what we want, unless you think it'll be better to have log files for tests. For that, we already have a testRuntime dependency on slf4j-simple (console logger). My concern is that it will pick log4j1 binding, find that the xml file is missing, and not log anything (like you saw in the diagnostics repartitioner)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prateekm yup that safeguard is good to have.

gradle :samza-test:test -i with that safeguard exclude logs to console

runtime project(":samza-log4j2_$scalaSuffix")
runtime project(":samza-yarn_$scalaSuffix")
runtime project(":samza-hdfs_$scalaSuffix")
compile "org.scala-lang:scala-library:$scalaVersion"
Expand Down
50 changes: 0 additions & 50 deletions samza-test/src/main/resources/log4j.xml

This file was deleted.

41 changes: 0 additions & 41 deletions samza-test/src/main/resources/log4j2.xml

This file was deleted.