You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by cu...@apache.org on 2019/01/23 21:07:33 UTC

[arrow] branch master updated: ARROW-4180: [Java] Make CI tests use logback.xml

This is an automated email from the ASF dual-hosted git repository.

cutlerb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 95788ce  ARROW-4180: [Java] Make CI tests use logback.xml
95788ce is described below

commit 95788cee33afad5266bbac9233c553945f72d24d
Author: Pindikura Ravindra <ra...@dremio.com>
AuthorDate: Wed Jan 23 13:07:22 2019 -0800

    ARROW-4180: [Java] Make CI tests use logback.xml
    
    - Add a logback.xml for each project with the default log level set to info.
    - Set the "verbose" property for git-commit-plugin to false
    - quieten output from qos.logback by attaching the NopStatusListener
    - Fix a bunch of doc errors in ArrowBuf.java
    
    Author: Pindikura Ravindra <ra...@dremio.com>
    
    Closes #3449 from pravindra/javalog and squashes the following commits:
    
    d70649d <Pindikura Ravindra> ARROW-4180: Remove info level for maven (it's the default)
    076fbd7 <Pindikura Ravindra> ARROW-4180: update README and add an appender
    ea3674b <Pindikura Ravindra> ARROW-4180: restore travis.yaml, set info loglevel
    c3fec21 <Pindikura Ravindra> ARROW-4180: Fix a typo in ci script
    b567651 <Pindikura Ravindra> ARROW-4180: quieten output from logback
    fc63176 <Pindikura Ravindra> ARROW-4180: add explicit logback.xml for each project
    cc3d496 <Pindikura Ravindra> ARROW-4180:  Make CI tests use logback.xml
---
 ci/travis_script_gandiva_java.sh                       |  2 --
 ci/travis_script_java.sh                               |  3 +--
 java/README.md                                         | 14 +++++---------
 .../jdbc/src/test/resources}/logback.xml               | 13 ++++++-------
 java/flight/src/test/resources/logback.xml             |  3 ++-
 java/gandiva/src/test/resources/logback.xml            | 11 ++++++++++-
 .../memory/src/main/java/io/netty/buffer/ArrowBuf.java | 18 +++++++++---------
 java/{dev => memory/src/test/resources}/logback.xml    | 13 ++++++-------
 java/{dev => plasma/src/test/resources}/logback.xml    | 13 ++++++-------
 java/pom.xml                                           |  2 +-
 java/{dev => tools/src/test/resources}/logback.xml     | 14 ++++++--------
 .../java/org/apache/arrow/util/AutoCloseables.java     |  6 +++---
 java/{dev => vector/src/test/resources}/logback.xml    | 13 ++++++-------
 13 files changed, 61 insertions(+), 64 deletions(-)

diff --git a/ci/travis_script_gandiva_java.sh b/ci/travis_script_gandiva_java.sh
index c187184..387be9a 100755
--- a/ci/travis_script_gandiva_java.sh
+++ b/ci/travis_script_gandiva_java.sh
@@ -24,8 +24,6 @@ JAVA_DIR=${TRAVIS_BUILD_DIR}/java
 
 pushd $JAVA_DIR
 
-export MAVEN_OPTS="$MAVEN_OPTS -Dorg.slf4j.simpleLogger.defaultLogLevel=warn"
-
 # build with gandiva profile
 $TRAVIS_MVN -P gandiva -B install -DskipTests -Dgandiva.cpp.build.dir=$CPP_BUILD_DIR/debug
 
diff --git a/ci/travis_script_java.sh b/ci/travis_script_java.sh
index dd5a6b4..201c336 100755
--- a/ci/travis_script_java.sh
+++ b/ci/travis_script_java.sh
@@ -24,8 +24,7 @@ source $TRAVIS_BUILD_DIR/ci/travis_env_common.sh
 JAVA_DIR=${TRAVIS_BUILD_DIR}/java
 pushd $JAVA_DIR
 
-export MAVEN_OPTS="$MAVEN_OPTS -Dorg.slf4j.simpleLogger.defaultLogLevel=warn"
-if [ $ARROW_TRAVIS_JAVA_BUILD_ONLY == "1" ]; then
+if [ "$ARROW_TRAVIS_JAVA_BUILD_ONLY" == "1" ]; then
     # Save time and make build less verbose by skipping tests and style checks
     $TRAVIS_MVN -DskipTests=true -Dcheckstyle.skip=true -B install
 else
diff --git a/java/README.md b/java/README.md
index 5a5f4d2..c69ff88 100644
--- a/java/README.md
+++ b/java/README.md
@@ -64,17 +64,13 @@ Refer to `java/dev/checkstyle/checkstyle.xml for rule specifics.
 ## Test Logging Configuration
 
 When running tests, Arrow Java uses the Logback logger with SLF4J. By default,
-Logback has a log level set to DEBUG. Besides setting this level
-programmatically, it can also be configured with a file named either
-"logback.xml" or "logback-test.xml" residing in the classpath. The file
-location can also be specified in the Maven command line with the following
-option `-Dlogback.configurationFile=file:<absolute-file-path>`. A sample
-logback.xml file is available in `java/dev` with a log level of ERROR. Arrow
-Java can be built with this file using the following command run in the project
-root directory:
+it uses the logback.xml present in the corresponding module's src/test/resources
+directory, which has the default log level set to INFO.
+Arrow Java can be built with an alternate logback configuration file using the
+following command run in the project root directory:
 
 ```bash
-mvn -Dlogback.configurationFile=file:`pwd`/dev/logback.xml
+mvn -Dlogback.configurationFile=file:<path-of-logback-file>
 ```
 
 See [Logback Configuration][1] for more details.
diff --git a/java/dev/logback.xml b/java/adapter/jdbc/src/test/resources/logback.xml
similarity index 84%
copy from java/dev/logback.xml
copy to java/adapter/jdbc/src/test/resources/logback.xml
index 10d5480..4c54d18 100644
--- a/java/dev/logback.xml
+++ b/java/adapter/jdbc/src/test/resources/logback.xml
@@ -1,3 +1,4 @@
+<?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
@@ -9,12 +10,8 @@
   OF ANY KIND, either express or implied. See the License for the specific
   language governing permissions and limitations under the License. -->
 
-<!-- This can be used when running tests with Maven by specifying the following option:
-$ mvn -Dlogback.configurationFile=file:${ARROW_HOME}/java/dev/logback.xml test
--->
-
 <configuration>
-
+  <statusListener class="ch.qos.logback.core.status.NopStatusListener"/>
   <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
     <!-- encoders are assigned the type
          ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
@@ -23,7 +20,9 @@ $ mvn -Dlogback.configurationFile=file:${ARROW_HOME}/java/dev/logback.xml test
     </encoder>
   </appender>
 
-  <root level="ERROR">
+  <logger name="org.apache.arrow" additivity="false">
+    <level value="info" />
     <appender-ref ref="STDOUT" />
-  </root>
+  </logger>
+
 </configuration>
diff --git a/java/flight/src/test/resources/logback.xml b/java/flight/src/test/resources/logback.xml
index e409e92..444b2ed 100644
--- a/java/flight/src/test/resources/logback.xml
+++ b/java/flight/src/test/resources/logback.xml
@@ -11,6 +11,7 @@
   language governing permissions and limitations under the License. -->
 
 <configuration>
+  <statusListener class="ch.qos.logback.core.status.NopStatusListener"/>
   <appender name="SOCKET"
     class="de.huxhorn.lilith.logback.appender.ClassicMultiplexSocketAppender">
     <Compressing>true</Compressing>
@@ -24,4 +25,4 @@
     <appender-ref ref="FILE" />
   </logger>
 
-</configuration>
\ No newline at end of file
+</configuration>
diff --git a/java/gandiva/src/test/resources/logback.xml b/java/gandiva/src/test/resources/logback.xml
index 9e23b55..f9e449f 100644
--- a/java/gandiva/src/test/resources/logback.xml
+++ b/java/gandiva/src/test/resources/logback.xml
@@ -11,9 +11,18 @@
   language governing permissions and limitations under the License. -->
 
 <configuration>
+  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+    <!-- encoders are assigned the type
+         ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
+    <encoder>
+      <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
+    </encoder>
+  </appender>
+
+  <statusListener class="ch.qos.logback.core.status.NopStatusListener"/>
   <logger name="org.apache.arrow" additivity="false">
     <level value="info" />
-    <appender-ref ref="FILE" />
+    <appender-ref ref="STDOUT" />
   </logger>
 
 </configuration>
diff --git a/java/memory/src/main/java/io/netty/buffer/ArrowBuf.java b/java/memory/src/main/java/io/netty/buffer/ArrowBuf.java
index bfe9701..5d37df5 100644
--- a/java/memory/src/main/java/io/netty/buffer/ArrowBuf.java
+++ b/java/memory/src/main/java/io/netty/buffer/ArrowBuf.java
@@ -791,7 +791,7 @@ public final class ArrowBuf extends AbstractByteBuf implements AutoCloseable {
   }
 
   /**
-   * @see  {@link #getShortLE(int)}.
+   * @see ArrowBuf#getShortLE(int).
    */
   @Override
   protected short _getShortLE(int index) {
@@ -804,7 +804,7 @@ public final class ArrowBuf extends AbstractByteBuf implements AutoCloseable {
   }
 
   /**
-   * @see  {@link #getIntLE(int)}.
+   * @see ArrowBuf#getIntLE(int).
    */
   @Override
   protected int _getIntLE(int index) {
@@ -812,7 +812,7 @@ public final class ArrowBuf extends AbstractByteBuf implements AutoCloseable {
   }
 
   /**
-   * @see  {@link #getUnsignedMedium(int)}.
+   * @see ArrowBuf#getUnsignedMedium(int).
    */
   @Override
   protected int _getUnsignedMedium(int index) {
@@ -820,7 +820,7 @@ public final class ArrowBuf extends AbstractByteBuf implements AutoCloseable {
   }
 
   /**
-   * @see  {@link #getUnsignedMediumLE(int)}.
+   * @see ArrowBuf#getUnsignedMediumLE(int).
    */
   @Override
   protected int _getUnsignedMediumLE(int index) {
@@ -833,7 +833,7 @@ public final class ArrowBuf extends AbstractByteBuf implements AutoCloseable {
   }
 
   /**
-   * @see  {@link #getLongLE(int)}.
+   * @see ArrowBuf#getLongLE(int).
    */
   @Override
   protected long _getLongLE(int index) {
@@ -851,7 +851,7 @@ public final class ArrowBuf extends AbstractByteBuf implements AutoCloseable {
   }
 
   /**
-   * @see  {@link #setShortLE(int, int)}.
+   * @see ArrowBuf#setShortLE(int, int).
    */
   @Override
   protected void _setShortLE(int index, int value) {
@@ -864,7 +864,7 @@ public final class ArrowBuf extends AbstractByteBuf implements AutoCloseable {
   }
 
   /**
-   * @see  {@link #setMediumLE(int, int)}.
+   * @see ArrowBuf#setMediumLE(int, int).
    */
   @Override
   protected void _setMediumLE(int index, int value) {
@@ -877,7 +877,7 @@ public final class ArrowBuf extends AbstractByteBuf implements AutoCloseable {
   }
 
   /**
-   * @see  {@link #setIntLE(int, int)}.
+   * @see ArrowBuf#setIntLE(int, int).
    */
   @Override
   protected void _setIntLE(int index, int value) {
@@ -890,7 +890,7 @@ public final class ArrowBuf extends AbstractByteBuf implements AutoCloseable {
   }
 
   /**
-   * @see  {@link #setLongLE(int, long)}.
+   * @see ArrowBuf#setLongLE(int, long).
    */
   @Override
   public void _setLongLE(int index, long value) {
diff --git a/java/dev/logback.xml b/java/memory/src/test/resources/logback.xml
similarity index 84%
copy from java/dev/logback.xml
copy to java/memory/src/test/resources/logback.xml
index 10d5480..4c54d18 100644
--- a/java/dev/logback.xml
+++ b/java/memory/src/test/resources/logback.xml
@@ -1,3 +1,4 @@
+<?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
@@ -9,12 +10,8 @@
   OF ANY KIND, either express or implied. See the License for the specific
   language governing permissions and limitations under the License. -->
 
-<!-- This can be used when running tests with Maven by specifying the following option:
-$ mvn -Dlogback.configurationFile=file:${ARROW_HOME}/java/dev/logback.xml test
--->
-
 <configuration>
-
+  <statusListener class="ch.qos.logback.core.status.NopStatusListener"/>
   <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
     <!-- encoders are assigned the type
          ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
@@ -23,7 +20,9 @@ $ mvn -Dlogback.configurationFile=file:${ARROW_HOME}/java/dev/logback.xml test
     </encoder>
   </appender>
 
-  <root level="ERROR">
+  <logger name="org.apache.arrow" additivity="false">
+    <level value="info" />
     <appender-ref ref="STDOUT" />
-  </root>
+  </logger>
+
 </configuration>
diff --git a/java/dev/logback.xml b/java/plasma/src/test/resources/logback.xml
similarity index 84%
copy from java/dev/logback.xml
copy to java/plasma/src/test/resources/logback.xml
index 10d5480..4c54d18 100644
--- a/java/dev/logback.xml
+++ b/java/plasma/src/test/resources/logback.xml
@@ -1,3 +1,4 @@
+<?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
@@ -9,12 +10,8 @@
   OF ANY KIND, either express or implied. See the License for the specific
   language governing permissions and limitations under the License. -->
 
-<!-- This can be used when running tests with Maven by specifying the following option:
-$ mvn -Dlogback.configurationFile=file:${ARROW_HOME}/java/dev/logback.xml test
--->
-
 <configuration>
-
+  <statusListener class="ch.qos.logback.core.status.NopStatusListener"/>
   <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
     <!-- encoders are assigned the type
          ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
@@ -23,7 +20,9 @@ $ mvn -Dlogback.configurationFile=file:${ARROW_HOME}/java/dev/logback.xml test
     </encoder>
   </appender>
 
-  <root level="ERROR">
+  <logger name="org.apache.arrow" additivity="false">
+    <level value="info" />
     <appender-ref ref="STDOUT" />
-  </root>
+  </logger>
+
 </configuration>
diff --git a/java/pom.xml b/java/pom.xml
index 28519b6..96385c0 100644
--- a/java/pom.xml
+++ b/java/pom.xml
@@ -261,7 +261,7 @@
 
         <configuration>
           <dateFormat>dd.MM.yyyy '@' HH:mm:ss z</dateFormat>
-          <verbose>true</verbose>
+          <verbose>false</verbose>
           <skipPoms>false</skipPoms>
           <generateGitPropertiesFile>true</generateGitPropertiesFile>
           <failOnNoGitDirectory>false</failOnNoGitDirectory>
diff --git a/java/dev/logback.xml b/java/tools/src/test/resources/logback.xml
similarity index 84%
copy from java/dev/logback.xml
copy to java/tools/src/test/resources/logback.xml
index 10d5480..ff848da 100644
--- a/java/dev/logback.xml
+++ b/java/tools/src/test/resources/logback.xml
@@ -1,3 +1,4 @@
+<?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
@@ -9,12 +10,8 @@
   OF ANY KIND, either express or implied. See the License for the specific
   language governing permissions and limitations under the License. -->
 
-<!-- This can be used when running tests with Maven by specifying the following option:
-$ mvn -Dlogback.configurationFile=file:${ARROW_HOME}/java/dev/logback.xml test
--->
-
 <configuration>
-
+  <statusListener class="ch.qos.logback.core.status.NopStatusListener"/>
   <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
     <!-- encoders are assigned the type
          ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
@@ -22,8 +19,9 @@ $ mvn -Dlogback.configurationFile=file:${ARROW_HOME}/java/dev/logback.xml test
       <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
     </encoder>
   </appender>
-
-  <root level="ERROR">
+  <logger name="org.apache.arrow" additivity="false">
+    <level value="info" />
     <appender-ref ref="STDOUT" />
-  </root>
+  </logger>
+
 </configuration>
diff --git a/java/vector/src/main/java/org/apache/arrow/util/AutoCloseables.java b/java/vector/src/main/java/org/apache/arrow/util/AutoCloseables.java
index d89478e..2f6ee9f 100644
--- a/java/vector/src/main/java/org/apache/arrow/util/AutoCloseables.java
+++ b/java/vector/src/main/java/org/apache/arrow/util/AutoCloseables.java
@@ -172,10 +172,10 @@ public final class AutoCloseables {
   }
 
   /**
-   * close() an {@see java.lang.AutoCloseable} without throwing a (checked)
-   * {@see java.lang.Exception}. This wraps the close() call with a
+   * close() an {@link java.lang.AutoCloseable} without throwing a (checked)
+   * {@link java.lang.Exception}. This wraps the close() call with a
    * try-catch that will rethrow an Exception wrapped with a
-   * {@see java.lang.RuntimeException}, providing a way to call close()
+   * {@link java.lang.RuntimeException}, providing a way to call close()
    * without having to do the try-catch everywhere or propagate the Exception.
    *
    * @param autoCloseable the AutoCloseable to close; may be null
diff --git a/java/dev/logback.xml b/java/vector/src/test/resources/logback.xml
similarity index 84%
rename from java/dev/logback.xml
rename to java/vector/src/test/resources/logback.xml
index 10d5480..f9e449f 100644
--- a/java/dev/logback.xml
+++ b/java/vector/src/test/resources/logback.xml
@@ -1,3 +1,4 @@
+<?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
@@ -9,12 +10,7 @@
   OF ANY KIND, either express or implied. See the License for the specific
   language governing permissions and limitations under the License. -->
 
-<!-- This can be used when running tests with Maven by specifying the following option:
-$ mvn -Dlogback.configurationFile=file:${ARROW_HOME}/java/dev/logback.xml test
--->
-
 <configuration>
-
   <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
     <!-- encoders are assigned the type
          ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
@@ -23,7 +19,10 @@ $ mvn -Dlogback.configurationFile=file:${ARROW_HOME}/java/dev/logback.xml test
     </encoder>
   </appender>
 
-  <root level="ERROR">
+  <statusListener class="ch.qos.logback.core.status.NopStatusListener"/>
+  <logger name="org.apache.arrow" additivity="false">
+    <level value="info" />
     <appender-ref ref="STDOUT" />
-  </root>
+  </logger>
+
 </configuration>