Log Output in DBUnit

风流意气都作罢 提交于 2019-12-22 05:47:09

问题


I feel that this is something I could easily figure out but I'm having a hard time finding information on how to change the log level of DBUnit. Can anyone solve this problem for me?


回答1:


When using log4j add the following to your log4j.properties:

# DbUnit
log4j.logger.org.dbunit=ERROR



回答2:


After avoiding the problem for a while, I came to a solution.

import org.slf4j.Logger
import org.slf4j.LoggerFactory
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.core.util.StatusPrinter;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;


Logger logger = (Logger)LoggerFactory.getLogger("org.dbunit")
logger.setLevel(Level. ERROR);

Hopefully this lead someone to a solution to their own similar problem.



来源:https://stackoverflow.com/questions/5980630/log-output-in-dbunit

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!