普通java项目指定外部日志配置文件



private static String log4jPath = System.getProperty("user.dir") + File.separator +

“network-log” + File.separator

+ “src” + File.separator + “main” + File.separator + “resources” + File.separator +

“log4j.properties”;

//指定生效配置文件

PropertyConfigurator.configure(log4jPath);