List of usage examples for java.util.logging Logger entering
public void entering(String sourceClass, String sourceMethod, Object params[])
From source file:MyHtmlFormatter.java
public static void main(String[] argv) throws Exception { Logger logger = Logger.getLogger("com.mycompany"); FileHandler fh = new FileHandler("mylog.html"); fh.setFormatter(new MyHtmlFormatter()); logger.addHandler(fh);//w w w .j av a 2 s . c o m logger.setLevel(Level.ALL); logger.severe("my severe message"); logger.info("my info message"); logger.entering("Main class", "myMethod", new Object[] { "para1", "para2" }); }
From source file:MyClass.java
public boolean myMethod(int p1, Object p2) { Logger logger = Logger.getLogger("com.mycompany.MyClass"); if (logger.isLoggable(Level.FINER)) { logger.entering(this.getClass().getName(), "myMethod", new Object[] { new Integer(p1), p2 }); }//from w w w. j av a 2s . c o m System.out.println("Method body"); boolean result = true; if (logger.isLoggable(Level.FINER)) { logger.exiting(this.getClass().getName(), "myMethod", new Boolean(result)); logger.exiting(this.getClass().getName(), "myMethod"); } return result; }