Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Log Output in DBUnit

Tags:

dbunit

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?

like image 625
KevinO Avatar asked May 12 '11 15:05

KevinO


2 Answers

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.

like image 63
KevinO Avatar answered Oct 27 '22 20:10

KevinO


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

# DbUnit
log4j.logger.org.dbunit=ERROR
like image 29
mip Avatar answered Oct 27 '22 18:10

mip