log4j 一会换行一会不换行的

2020-11-11 15:56:47 +08:00
 wk1563396689
11-11 15:48:02 ==> Received ready msg from worker
11-11 15:52:01 ==> Start service daemon by auroravm on Linux.
11-11 15:52:01 ==> init monitor status:true
11-11 15:52:01 ==> Starting service
11-11 15:52:01 ==> Connecting to Message Agent tcp://localhost:6666
11-11 15:52:01 ==> Registering services
11-11 15:52:01 ==> Received ready msg from worker11-11 07:52:40 INFO Admin.Daemon ServiceDaemon.java:454 - ==> Received new task from Message Agent, dispatch msg to worker.
11-11 15:52:40 ==> Start user=aurora@aurora-system.com, project=Byte1,folder=523930175671504896, task=Rocky Simulation.


可以看到倒数第二行就不换行了

采用的 springboot 框架,截取了一段配置如下

<Properties>
<Property name="logDir">log</Property>
<Property name="logFile">${sys:log_name}</Property>
<Property name="adminLogFile">${sys:log_name}_admin</Property>
<Property name="LOG_PATTERN">%d{MM-dd HH:mm:ss}{UTC} %-5level %logger{36} %file:%line - %msg%xEx%n</Property>
</Properties>
<Appenders>
<!-- Async Loggers will auto-flush in batches, so switch off immediateFlush. -->
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="${LOG_PATTERN}"/>
</Console>

<RollingFile name="adminFile" fileName="${logDir}/${adminLogFile}.log" append="true"
filePattern="${logDir}/%d{MM-dd-yyyy}{UTC}-%i.${adminLogFile}.log.gz">
<PatternLayout pattern="${LOG_PATTERN}"/>
<RegexFilter regex=".*/api/v3/backend/log.*" onMatch="DENY" onMismatch="ACCEPT"/>
<Policies>
<OnStartupTriggeringPolicy />
<TimeBasedTriggeringPolicy interval="12"/>
<SizeBasedTriggeringPolicy size="50MB"/>
</Policies>
<DefaultRolloverStrategy>
<Delete basePath="${logDir}/" maxDepth="2">
<IfFileName glob="*.${adminLogFile}.log.gz" />
<IfLastModified age="7d" />
</Delete>
</DefaultRolloverStrategy>
</RollingFile>
</Appenders>
574 次点击
所在节点    问与答
1 条回复
wk1563396689
2020-11-12 10:51:48 +08:00
这个没人回复么。。。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/724076

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX