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

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new f3dbb772d3 Better logging (to help investigate occasional NPEs)
f3dbb772d3 is described below

commit f3dbb772d3d5d7c0f5dede496d180e2548eda38a
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Jan 23 13:59:20 2025 +0000

    Better logging (to help investigate occasional NPEs)
---
 test/org/apache/catalina/connector/TestCoyoteAdapter.java | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/test/org/apache/catalina/connector/TestCoyoteAdapter.java 
b/test/org/apache/catalina/connector/TestCoyoteAdapter.java
index 0aa87ea0ec..e694c27db7 100644
--- a/test/org/apache/catalina/connector/TestCoyoteAdapter.java
+++ b/test/org/apache/catalina/connector/TestCoyoteAdapter.java
@@ -311,8 +311,12 @@ public class TestCoyoteAdapter extends TomcatBaseTest {
 
         for (int i = 0; i < 10; i++) {
             String line = client.readLine();
-            if (line != null && line.length() > 20) {
-                log.info(line.subSequence(0, 20) + "...");
+            if (line != null) {
+                if (line.length() > 20) {
+                    log.info(line.subSequence(0, 20) + "...");
+                } else {
+                    log.info(line);
+                }
             }
         }
 
@@ -404,7 +408,7 @@ public class TestCoyoteAdapter extends TomcatBaseTest {
                             os.flush();
                             Thread.sleep(1000);
                         } catch (Exception e) {
-                            log.info("Exception caught " + e);
+                            log.info("Exception caught " + e, e);
                             try {
                                 // Note if request times out before this
                                 // exception is thrown and the complete call


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to