JDK工具类_____java.util.loggingLogger
import java.util.logging.Logger;
/**
* @author Administrator jdk日志操作工具类
*/
public class JdkLog {
public static Logger logger = Logger.getLogger(JdkLog.class.getName());
public static void getjdkLog() {
logger.info("这是jdk的util自带的日志记录工具....");
logger.info("进入该方法记录一下日志:" + JdkLog.class.getName() + "____start");
System.out.println("logger.getName()__________:" + logger.getName());
System.out.println("logger.getClass()__________:" + logger.getClass());
System.out.println("logger.getFilter()__________:" + logger.getFilter());
System.out.println("logger.getHandlers()__________:" + logger.getHandlers());
System.out.println("logger.getLevel()__________:" + logger.getLevel());
System.out.println("logger.getParent()__________:" + logger.getParent());
logger.info("该方法结束后记录一下日志:" + JdkLog.class.getName() + "____end");
}
public static void main(String[] args) {
getjdkLog();
}
}
//运行结果
二月 15, 2017 9:00:49 上午 com.net.socket.JdkLog getjdkLog
信息: 这是jdk的util自带的日志记录工具....
二月 15, 2017 9:00:49 上午 com.net.socket.JdkLog getjdkLog
信息: 进入该方法记录一下日志:com.net.socket.JdkLog____start
logger.getName()__________:com.net.socket.JdkLog
logger.getClass()__________:class java.util.logging.Logger
logger.getFilter()__________:null
logger.getHandlers()__________:[Ljava.util.logging.Handler;@56ce9bde
logger.getLevel()__________:null
logger.getParent()__________:java.util.logging.LogManager$RootLogger@165b3858
二月 15, 2017 9:00:49 上午 com.net.socket.JdkLog getjdkLog
信息: 该方法结束后记录一下日志:com.net.socket.JdkLog____end
//