只需在main方法加上文件路径配置,打包后就可在外部修改日志文件输出的配置
![](https://i-blog.csdnimg.cn/blog_migrate/75dc10dc67d9817eabb03ecade41f73f.png)
config是日志文件路径,在main方法里加上如下代码即可
TxxApplication txxApplication = new TxxApplication();
String path = txxApplication.getPath() + "/config" + "/log4j2.xml";
System.setProperty("logging.config", path);
只需在main方法加上文件路径配置,打包后就可在外部修改日志文件输出的配置
config是日志文件路径,在main方法里加上如下代码即可
TxxApplication txxApplication = new TxxApplication();
String path = txxApplication.getPath() + "/config" + "/log4j2.xml";
System.setProperty("logging.config", path);