You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ho...@apache.org on 2022/09/23 21:03:57 UTC

[solr] branch branch_9x updated: Use synchronous logging in all module tests

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

houston pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new 5557e1fd7ba Use synchronous logging in all module tests
5557e1fd7ba is described below

commit 5557e1fd7ba02d9179bf9e29141a56c0d929d129
Author: Houston Putman <ho...@apache.org>
AuthorDate: Fri Sep 23 16:52:00 2022 -0400

    Use synchronous logging in all module tests
    
    (cherry picked from commit 1d8292285ae4ff9bee594500f372350b21f872fa)
---
 .../gcs-repository/src/test-files/log4j2.xml       | 43 ++++------------------
 .../s3-repository/src/test-files/log4j2.xml        | 33 ++---------------
 2 files changed, 10 insertions(+), 66 deletions(-)

diff --git a/solr/modules/gcs-repository/src/test-files/log4j2.xml b/solr/modules/gcs-repository/src/test-files/log4j2.xml
index 6b02a3b06b4..528299e3e0b 100644
--- a/solr/modules/gcs-repository/src/test-files/log4j2.xml
+++ b/solr/modules/gcs-repository/src/test-files/log4j2.xml
@@ -15,7 +15,7 @@
   See the License for the specific language governing permissions and
   limitations under the License.
   -->
-<!-- Configuration for asynchronous logging -->
+<!-- We're configuring testing to be synchronous due to "logging polution", see SOLR-13268 -->
 <Configuration>
   <Appenders>
     <Console name="STDERR" target="SYSTEM_ERR">
@@ -28,42 +28,13 @@
     </Console>
   </Appenders>
   <Loggers>
-    <AsyncLogger name="org.apache.zookeeper" level="WARN"/>
-    <AsyncLogger name="org.apache.hadoop" level="WARN"/>
-    <AsyncLogger name="org.apache.directory" level="WARN"/>
-    <AsyncLogger name="org.apache.solr.hadoop" level="INFO"/>
-    <AsyncLogger name="org.eclipse.jetty" level="INFO"/>
+    <!-- Use <AsyncLogger/<AsyncRoot and <Logger/<Root for asynchronous logging or synchonous logging respectively -->
+    <Logger name="org.apache.zookeeper" level="WARN"/>
+    <Logger name="org.apache.directory" level="WARN"/>
+    <Logger name="org.eclipse.jetty" level="INFO"/>
 
-    <AsyncRoot level="INFO">
+    <Root level="INFO">
       <AppenderRef ref="STDERR"/>
-    </AsyncRoot>
+    </Root>
   </Loggers>
 </Configuration>
-
-<!-- Configuration for synchronous logging
-     there _may_ be a very small window where log messages will not be flushed
-     to the log file on abnormal shutdown. If even this risk is unacceptable, use
-     the configuration below
--->
-<!--Configuration>
-<Appenders>
-  <Console name="STDERR" target="SYSTEM_ERR">
-    <PatternLayout>
-      <Pattern>
-        %-4r %-5p (%t) [%notEmpty{n:%X{node_name}}%notEmpty{ c:%X{collection}}%notEmpty{ s:%X{shard}}%notEmpty{ r:%X{replica}}%notEmpty{ x:%X{core}}] %c{1.} %m%n
-      </Pattern>
-    </PatternLayout>
-  </Console>
-</Appenders>
-<Loggers>
-  <Logger name="org.apache.zookeeper" level="WARN"/>
-  <Logger name="org.apache.hadoop" level="WARN"/>
-  <Logger name="org.apache.directory" level="WARN"/>
-  <Logger name="org.apache.solr.hadoop" level="INFO"/>
-  <Logger name="org.eclipse.jetty" level="INFO"/>
-
-  <Root level="INFO">
-    <AppenderRef ref="STDERR"/>
-  </Root>
-</Loggers>
-</Configuration-->
diff --git a/solr/modules/s3-repository/src/test-files/log4j2.xml b/solr/modules/s3-repository/src/test-files/log4j2.xml
index 950caea970d..96f69f1dc8b 100644
--- a/solr/modules/s3-repository/src/test-files/log4j2.xml
+++ b/solr/modules/s3-repository/src/test-files/log4j2.xml
@@ -15,8 +15,8 @@
   See the License for the specific language governing permissions and
   limitations under the License.
   -->
-<!-- Configuration for asynchronous logging -->
-<!--Configuration>
+<!-- We're configuring testing to be synchronous due to "logging polution", see SOLR-13268 -->
+<Configuration>
   <Appenders>
     <Console name="STDERR" target="SYSTEM_ERR">
       <PatternLayout>
@@ -28,34 +28,7 @@
     </Console>
   </Appenders>
   <Loggers>
-    <AsyncLogger name="org.apache.zookeeper" level="WARN"/>
-    <AsyncLogger name="org.apache.hadoop" level="WARN"/>
-    <AsyncLogger name="org.apache.directory" level="WARN"/>
-    <AsyncLogger name="org.apache.solr.hadoop" level="INFO"/>
-    <AsyncLogger name="org.eclipse.jetty" level="INFO"/>
-
-    <AsyncRoot level="INFO">
-      <AppenderRef ref="STDERR"/>
-    </AsyncRoot>
-  </Loggers>
-</Configuration-->
-
-<!-- Configuration for synchronous logging
-     there _may_ be a very small window where log messages will not be flushed
-     to the log file on abnormal shutdown. If even this risk is unacceptable, use
-     the configuration below
--->
-<Configuration>
-  <Appenders>
-    <Console name="STDERR" target="SYSTEM_ERR">
-      <PatternLayout>
-        <Pattern>
-          %-4r %-5p (%t) [%notEmpty{n:%X{node_name}}%notEmpty{ c:%X{collection}}%notEmpty{ s:%X{shard}}%notEmpty{ r:%X{replica}}%notEmpty{ x:%X{core}}] %c{1.} %m%n
-        </Pattern>
-      </PatternLayout>
-    </Console>
-  </Appenders>
-  <Loggers>
+    <!-- Use <AsyncLogger/<AsyncRoot and <Logger/<Root for asynchronous logging or synchonous logging respectively -->
     <Logger name="org.apache.zookeeper" level="WARN"/>
     <Logger name="org.apache.hadoop" level="WARN"/>
     <Logger name="org.apache.directory" level="WARN"/>