Skip to content

Commit

Permalink
Revert "SAMZA-2155: Remove log4j log4j2 dependency from samza-test"
Browse files Browse the repository at this point in the history
This reverts commit f260be6.
  • Loading branch information
Boris S committed May 25, 2019
1 parent b786d8b commit e1194b1
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 3 deletions.
5 changes: 2 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -838,9 +838,6 @@ 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 @@ -851,6 +848,8 @@ project(":samza-test_$scalaSuffix") {
compile project(":samza-core_$scalaSuffix")
compile project(":samza-kafka_$scalaSuffix")
compile project(":samza-sql_$scalaSuffix")
runtime project(":samza-log4j_$scalaSuffix")
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: 50 additions & 0 deletions samza-test/src/main/resources/log4j.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- 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. -->
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[%t] %c{1} [%p] %m%n" />
</layout>
</appender>

<root>
<priority value="info" />
<appender-ref ref="console" />
</root>

<logger name="STARTUP_LOGGER" additivity="false">
<level value="info" />
<appender-ref ref="console"/>
</logger>

<logger name="org.apache.hadoop">
<level value="ERROR"/>
</logger>
<logger name="org.I0Itec.zkclient">
<level value="ERROR"/>
</logger>
<logger name="org.apache.zookeeper">
<level value="ERROR"/>
</logger>
<logger name="org.apache.samza.system.kafka">
<level value="ERROR"/>
</logger>
<logger name="org.apache.kafka">
<level value="ERROR"/>
</logger>
<logger name="kafka">
<level value="ERROR"/>
</logger>
</log4j:configuration>
41 changes: 41 additions & 0 deletions samza-test/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- 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>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="[%t] %c{1} [%p] %m%n"/>
</Console>
</Appenders>
<Loggers>
<Root level="info">
<AppenderRef ref="STDOUT"/>
</Root>

<Logger name="STARTUP_LOGGER" level="info" additivity="false">
<AppenderRef ref="STDOUT"/>
</Logger>

<Logger name="org.apache.hadoop" level="error"></Logger>

<Logger name="org.I0Itec.zkclient" level="error"></Logger>

<Logger name="org.apache.zookeeper" level="error"></Logger>

<Logger name="org.apache.samza.system.kafka" level="error"></Logger>

<Logger name="org.apache.kafka" level="error"></Logger>

<Logger name="kafka" level="error"></Logger>

</Loggers>
</Configuration>

0 comments on commit e1194b1

Please sign in to comment.