diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/log/StdErrLog.java b/jetty-util/src/main/java/org/eclipse/jetty/util/log/StdErrLog.java index 58bf8df615e..e8af4298c52 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/log/StdErrLog.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/log/StdErrLog.java @@ -132,7 +132,7 @@ public class StdErrLog implements Logger tag(d,ms,":DBUG:"); format(msg); if (_hideStacks) - format(th.toString()); + format(String.valueOf(th)); else format(th); System.err.println(_buffer.toString()); @@ -203,7 +203,7 @@ public class StdErrLog implements Logger tag(d,ms,":WARN:"); format(msg); if (_hideStacks) - format(th.toString()); + format(String.valueOf(th)); else format(th); System.err.println(_buffer.toString()); diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/log/StdErrLogTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/log/StdErrLogTest.java index bdda51facd8..f54df1e6b88 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/log/StdErrLogTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/log/StdErrLogTest.java @@ -24,6 +24,7 @@ public class StdErrLogTest extends TestCase { StdErrLog log = new StdErrLog(); log.setDebugEnabled(true); + log.setHideStacks(true); try { log.info("Testing info(msg,null,null) - {} {}",null,null); @@ -52,9 +53,9 @@ public class StdErrLogTest extends TestCase } catch (NullPointerException npe) { - assertTrue("NullPointerException in StdErrLog.", false); System.err.println(npe); npe.printStackTrace(); + assertTrue("NullPointerException in StdErrLog.", false); } } }