打开IDEA,进入工程,选择Edit Configurations 选择logs,注意:给save console output to file 打对勾,并选择要写到哪个文件里。 路径不要只到文件夹,具体到.txt文件。不然无法生成。