I'm using the org.slf4j.Logger in a Java EJB-Project running on a glassfish 3.1.2 server.
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class main {
private static final Logger LOGGER = LoggerFactory.getLogger(main.class);
public static void main(String[] args) {
LOGGER.info("--- show this everytime");
if(LOGGER.isDebugEnabled()) {
LOGGER.debug("--- show this only if debug is enable");
}
LOGGER.info("--- show this everytime");
}
So my Problem is, I don't know how to turn on/off the different log level (info, debug, error, trace, warn). I read about create a config-file or xml-file, but I don't know where to put these files in a EJB-Project. And is there a way to configure it like this?
LOGGER.setLevel("info");