Log4j basic configuration

log4j

I used log4j to log some steps in my application. To be quick and dirty, I used:

org.apache.log4j.BasicConfigurator.configure();

This output my logs in the Eclipse console.

I want to know if and how to set the level threshold higher than DEBUG? In other word, I do not want to display DEBUG level message, just ERR, WARN, INFO.

Thank you.

EDIT:
May I use this following?

import org.apache.log4j.Logger;
import org.apache.log4j.Level;
[...]
Logger logger = Logger.getLogger(this.class);
logger.setLevel(Level.INFO);

Best Answer

I think the simplest way would be:

    Logger.getRootLogger().setLevel(Level.INFO);
Related Topic