在main方法中掉HttpClient请求, System.out.print()的日志在控制台不好找;可以通过修改http请求level来控制日志输出
这里是源码level 所有级别;文章来源:https://www.toymoban.com/news/detail-745335.html
public static final Level OFF = new Level(2147483647, "OFF");
public static final Level ERROR = new Level(40000, "ERROR");
public static final Level WARN = new Level(30000, "WARN");
public static final Level INFO = new Level(20000, "INFO");
public static final Level DEBUG = new Level(10000, "DEBUG");
public static final Level TRACE = new Level(5000, "TRACE");
public static final Level ALL = new Level(-2147483648, "ALL");
解决方法是在main方法后添加文章来源地址https://www.toymoban.com/news/detail-745335.html
//去除http请求bug日志
((LoggerContext) LoggerFactory.getILoggerFactory())
.getLogger("org.apache.http")
.setLevel(Level.ERROR);
到了这里,关于关闭HttpClient请求日志的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!