jjzjj

LoggingExample1

全部标签

java - 我们如何删除日志文件中的额外消息

我有一个简单的日志记录程序,即:publicclassLoggingExample1{publicstaticvoidmain(Stringargs[]){try{LogManagerlm=LogManager.getLogManager();Loggerlogger;FileHandlerfh=newFileHandler("log_test.txt");logger=Logger.getLogger("LoggingExample1");lm.addLogger(logger);logger.setLevel(Level.INFO);fh.setFormatter(newSimpl