在我的Java应用程序中记录日志配置
我正在使用一个名为JSONPath
的库来解析Java中的JSON消息。我应该始终添加以下代码,以使其redundent日志消失
在log4j.xml
文件或我的代码本身之外的其他地方有什么方法可以做到这一点吗?我只是不想在技术代码中看到这一点
// must be added for the JSONPath debug logs to disappear.
LoggerContext logContext = (LoggerContext) LoggerFactory.getILoggerFactory();
ch.qos.logback.classic.Logger log = logContext.getLogger("com.jayway.jsonpath.internal.path.CompiledPath");
log.setLevel(Level.INFO);
共 (0) 个答案