简体   繁体   中英

How to silence exception stack trace from Play framework stdout

I'm receiving a,

java.lang.NullPointerException
    at play.core.server.netty.RequestBodyHandler$class.finish$1(RequestBodyHandler.scala:70)
    at play.core.server.netty.RequestBodyHandler$$anonfun$pushChunk$1$2$$anonfun$apply$2.apply(RequestBodyHandler.scala:53)
    at play.core.server.netty.RequestBodyHandler$$anonfun$pushChunk$1$2$$anonfun$apply$2.apply(RequestBodyHandler.scala:49)
    at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:29)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

printed to the console when reloading a page in the Play framework. The cause is irrelevant for the purpose of this question. I've tried to suppress the message but can not seem to figure it out. Even with ALL logback logging turned OFF this is the only message that is still printed.

Where is it coming from and how do I stop it?

My guess is there is some code that is calling Exception.printStackTrace() rather that utilizing the logger. I did a quick google to figure out how to redirect standard error to a logger, but didn't immediately find the solution for ya. I know that log4j can do this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM