setLevel of java.util.logging.Level
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.LogManager;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;
import java.util.logging.StreamHandler;
public class test{
public static void main(String[] args){
Logger l = Logger.getLogger("com.test");
l.setLevel(Level.FINE);
Handler[] handlers1 = l.getLogger("").getHandlers();
for (int index = 0; index < handlers1.length; index++)
{
handlers1[index].setLevel(Level.FINE);
}
l.severe("SEVERE ");
l.warning("WARNING ");
l.config("CONFIG");
l.info("INFO");
l.fine("FINE");
l.finer("FINER");
l.finest("FINEST");
}
}
评论
发表评论