今天运行一个jar包,jar包中使用了springContext进行加载bean和log4j配置,但是发现不能正常输入日志。

代码中增加

Xxx.class.getResource("/");

 输出classpath,但是输出结果是null

查找后可以手动加载log4j配置文件

PropertyConfigurator.configure("/export/server/runjar/log4j.properties"); 

  问题解决

相关文章:

  • 2022-01-16
  • 2022-02-21
  • 2021-08-01
  • 2021-05-27
猜你喜欢
  • 2021-07-28
  • 2022-03-07
  • 2021-09-23
  • 2021-06-24
  • 2021-12-31
  • 2021-08-14
相关资源
相似解决方案