我使用 log4j 登录我的应用程序。在每节课中,我都需要记录以下内容:
Properties props = new Properties();
try {
props.load(new FileInputStream("/log4j.properties"));
} catch (Exception e){
LOG.error(e);
}
PropertyConfigurator.configure(props);
log4j.properties 放在文件夹 /src/main/resources/
IDEA 给出路径 /log4.properties 作为复制参考。当我启动我的应用程序时,它显示 FileNotFoundException