What's the best way to suppress a runtime console warning in Java?

前端 未结 7 1410
情歌与酒
情歌与酒 2021-02-07 07:15

I am using the getResponseBody() method of the org.apache.commons.httpclient.methods.PostMethod class. However, I am always getting a message written to the console at runtime:

7条回答
  •  遥遥无期
    2021-02-07 08:17

    Is the library outputting through log4j? if so, editing the log4j.properties to set the output for this class to "ERROR" would work, e.g.

    log4j.logger.org.apache.commons.httpclient.methods.PostMethod=ERROR
    

提交回复
热议问题