java log4j2日志行号不显示问题

1、检查jar包

 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>
原文地址:https://www.cnblogs.com/bestzhang/p/14813757.html