Java examples for Java Virtual Machine:Logger
Writing Log Records to Standard Error
import java.util.logging.ConsoleHandler; import java.util.logging.Logger; public class Main { public void m() throws Exception { // Create a console handler ConsoleHandler handler = new ConsoleHandler(); // Add to logger Logger logger = Logger.getLogger("com.mycompany"); logger.addHandler(handler);//from w w w . j av a 2 s .c o m } }