1、检查jar包

java log4j2日志行号不显示问题

 

 

 2、日志配置

<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
</Console>

<root level="info">
<AppenderRef ref="Console" />
</root>


3、异步日志注意增加( includeLocation="true">)

 本次问题症结所在,因为定位不到原地址

<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
</Console>

<AsyncRoot level="info" includeLocation="true">
<AppenderRef ref="Console" />
</AsyncRoot>

相关文章:

  • 2021-06-15
  • 2022-12-23
  • 2022-12-23
  • 2021-05-06
  • 2021-09-22
  • 2022-12-23
  • 2021-12-08
猜你喜欢
  • 2022-12-23
  • 2021-12-16
  • 2022-12-23
  • 2021-08-05
  • 2022-12-23
  • 2021-11-13
相关资源
相似解决方案