From fd3e297cc3fe8b12a9e116bb83f91a4edd9a28a0 Mon Sep 17 00:00:00 2001 From: david dali susanibar arce Date: Thu, 5 Oct 2023 13:35:55 -0500 Subject: [PATCH] GH-38005: [Java] disable the debug log when running Java tests (#38006) ### Rationale for this change To disable the debug log when running Java tests ### What changes are included in this PR? Java Testing resource that configure SLF4J API and adapters. ### Are these changes tested? Yes ### Are there any user-facing changes? No * Closes: #38005 Authored-by: David Susanibar Arce Signed-off-by: David Li --- docs/source/developers/java/development.rst | 14 ++++++++++ .../avro/src/test/resources/logback.xml | 28 +++++++++++++++++++ java/algorithm/src/test/resources/logback.xml | 28 +++++++++++++++++++ .../src/test/resources/logback.xml | 28 +++++++++++++++++++ .../src/test/resources/logback.xml | 28 +++++++++++++++++++ .../src/test/resources/logback.xml | 28 +++++++++++++++++++ .../flight-sql/src/test/resources/logback.xml | 28 +++++++++++++++++++ .../src/test/resources/logback.xml | 28 +++++++++++++++++++ .../src/test/resources/logback.xml | 28 +++++++++++++++++++ 9 files changed, 238 insertions(+) create mode 100644 java/adapter/avro/src/test/resources/logback.xml create mode 100644 java/algorithm/src/test/resources/logback.xml create mode 100644 java/compression/src/test/resources/logback.xml create mode 100644 java/flight/flight-grpc/src/test/resources/logback.xml create mode 100644 java/flight/flight-integration-tests/src/test/resources/logback.xml create mode 100644 java/flight/flight-sql/src/test/resources/logback.xml create mode 100644 java/memory/memory-core/src/test/resources/logback.xml create mode 100644 java/memory/memory-unsafe/src/test/resources/logback.xml diff --git a/docs/source/developers/java/development.rst b/docs/source/developers/java/development.rst index ce7e1704f641c..f7b19d73da2e2 100644 --- a/docs/source/developers/java/development.rst +++ b/docs/source/developers/java/development.rst @@ -23,6 +23,20 @@ Development Guidelines .. contents:: +Logger Abstraction +================== + +Apache Arrow Java uses the SLF4J API, so please configure SLF4J to see logs (e.g. via Logback/Apache Log4j): + +1. If no jar dependencies are added by the user via Logback or Apache Log4j then SLF4J will default + to no-operation (NOP) logging. + +2. If a user adds any dependencies via Logback or Apache Log4j but does not configure/add/define + logback.xml/log4j2.xml, then logs will default to DEBUG mode. + +3. To disable debug logs, the user must define their own rules within their logback.xml/log4j2.xml + and define their own loggers. + Unit Testing ============ Unit tests are run by Maven during the build. diff --git a/java/adapter/avro/src/test/resources/logback.xml b/java/adapter/avro/src/test/resources/logback.xml new file mode 100644 index 0000000000000..4c54d18a210ff --- /dev/null +++ b/java/adapter/avro/src/test/resources/logback.xml @@ -0,0 +1,28 @@ + + + + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + diff --git a/java/algorithm/src/test/resources/logback.xml b/java/algorithm/src/test/resources/logback.xml new file mode 100644 index 0000000000000..4c54d18a210ff --- /dev/null +++ b/java/algorithm/src/test/resources/logback.xml @@ -0,0 +1,28 @@ + + + + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + diff --git a/java/compression/src/test/resources/logback.xml b/java/compression/src/test/resources/logback.xml new file mode 100644 index 0000000000000..4c54d18a210ff --- /dev/null +++ b/java/compression/src/test/resources/logback.xml @@ -0,0 +1,28 @@ + + + + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + diff --git a/java/flight/flight-grpc/src/test/resources/logback.xml b/java/flight/flight-grpc/src/test/resources/logback.xml new file mode 100644 index 0000000000000..4c54d18a210ff --- /dev/null +++ b/java/flight/flight-grpc/src/test/resources/logback.xml @@ -0,0 +1,28 @@ + + + + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + diff --git a/java/flight/flight-integration-tests/src/test/resources/logback.xml b/java/flight/flight-integration-tests/src/test/resources/logback.xml new file mode 100644 index 0000000000000..95fb0b37dc5d3 --- /dev/null +++ b/java/flight/flight-integration-tests/src/test/resources/logback.xml @@ -0,0 +1,28 @@ + + + + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + diff --git a/java/flight/flight-sql/src/test/resources/logback.xml b/java/flight/flight-sql/src/test/resources/logback.xml new file mode 100644 index 0000000000000..4c54d18a210ff --- /dev/null +++ b/java/flight/flight-sql/src/test/resources/logback.xml @@ -0,0 +1,28 @@ + + + + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + diff --git a/java/memory/memory-core/src/test/resources/logback.xml b/java/memory/memory-core/src/test/resources/logback.xml new file mode 100644 index 0000000000000..4c54d18a210ff --- /dev/null +++ b/java/memory/memory-core/src/test/resources/logback.xml @@ -0,0 +1,28 @@ + + + + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + diff --git a/java/memory/memory-unsafe/src/test/resources/logback.xml b/java/memory/memory-unsafe/src/test/resources/logback.xml new file mode 100644 index 0000000000000..4c54d18a210ff --- /dev/null +++ b/java/memory/memory-unsafe/src/test/resources/logback.xml @@ -0,0 +1,28 @@ + + + + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + +