我正在尝试将事件写入日志文件,但没有创建文件。我完全没有错误。这是日志类:
public class Logs {
static FileHandler fileTxt;
static SimpleFormatter formatterTxt;
static public void logging() throws IOException {
Logger logger = Logger.getLogger("");
logger.setLevel(Level.INFO);//Loget Info, Warning dhe Severe do ruhen
fileTxt = new FileHandler("c:/SimleTaskEvents.txt");
formatterTxt = new SimpleFormatter();
fileTxt.setFormatter(formatterTxt);
logger.addHandler(fileTxt);
}
}
最佳答案
关于java - (Java) 将事件写入日志文本文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13970595/