import java.util.logging.ConsoleHandler;
import java.util.logging.Filter;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
public class Main {
public static void main(String[] argv) throws Exception {
ConsoleHandler handler = new ConsoleHandler();
handler.setFilter(new Filter() {
public boolean isLoggable(LogRecord record) {
return true;
}
});
// Add the handler to a logger
Logger logger = Logger.getLogger("com.mycompany");
logger.addHandler(handler);
}
}
|