I have a spring mvc app running in eclipse with hibernate and slf4j. I would like to turn off hibernate logging in the console because it is burying other console messages that I want to be able to see. How can I turn off hibernate logging?
I have done a number of web searches on this topic, and looked at other postings on stack overflow, but the other postings do not answer my question. For example, the following code from another posting will not compile in eclipse because it gives messages that the methods are not part of the objects, even when I import every possible set of packages for the given object:
List<Logger> loggers = Collections.<Logger>list(LogManager.getCurrentLoggers());
loggers.add(LogManager.getRootLogger());
for ( Logger logger : loggers ) {
logger.setLevel(Level.OFF);
}
Also, doing a key word search in my workspace for show_sql
produced no results, so it seems that I cannot just set hibernate.show_sql
to false.
Perhaps the other solutions are for outdated versions of the libraries? I am using eclipse kepler, slf4 1.7.5 and hibernate 4.2.