Java examples for Java Virtual Machine:Logger
Preventing a Logger from Forwarding Log Records to Its Parent
import java.util.logging.Logger; public class Main { public void m() { // Get a logger Logger logger = Logger.getLogger("com.mycompany"); // Stop forwarding log records to ancestor handlers logger.setUseParentHandlers(false);/* w w w . j ava2 s. c om*/ // Start forwarding log records to ancestor handlers logger.setUseParentHandlers(true); } }