Browse Source

add error rolling

tags/1.4.0^2
imuge 3 years ago
parent
commit
ba4b2c4188
3 changed files with 25 additions and 5 deletions
  1. +1
    -1
      core
  2. +12
    -2
      deploy/deploy-gateway/src/main/resources/config/log4j2-gw.xml
  3. +12
    -2
      deploy/deploy-peer/src/main/resources/config/log4j2-peer.xml

+ 1
- 1
core

@@ -1 +1 @@
Subproject commit bfbb6267d14b8b59a7d0b5593bc4b5958dbb3680
Subproject commit e8fadcf5399e4005d1089838d556e5997e04d036

+ 12
- 2
deploy/deploy-gateway/src/main/resources/config/log4j2-gw.xml View File

@@ -2,18 +2,27 @@
<configuration status="WARN" monitorInterval="60"> <configuration status="WARN" monitorInterval="60">
<appenders> <appenders>
<console name="Console" target="SYSTEM_OUT"> <console name="Console" target="SYSTEM_OUT">
<ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/>
<ThresholdFilter level="all" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %class{36} %L %M - %msg%xEx%n"/> <PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %class{36} %L %M - %msg%xEx%n"/>
</console> </console>
<RollingFile name="GWRolling" fileName="${sys:jdchain.log}/gw.log" <RollingFile name="GWRolling" fileName="${sys:jdchain.log}/gw.log"
filePattern="${sys:jdchain.log}/$${date:yyyy-MM}/gw-%d{yyyy-MM-dd}-%i.log"> filePattern="${sys:jdchain.log}/$${date:yyyy-MM}/gw-%d{yyyy-MM-dd}-%i.log">
<PatternLayout pattern="[%d{HH:mm:ss:SSS}] [%p] - %l - %m%n"/>
<PatternLayout pattern="[%date{yyyy-MM-dd HH:mm:ss:SSS}] [%thread] [%p] - %l - %m%n"/>
<Policies> <Policies>
<TimeBasedTriggeringPolicy/> <TimeBasedTriggeringPolicy/>
<SizeBasedTriggeringPolicy size="250 MB"/> <SizeBasedTriggeringPolicy size="250 MB"/>
</Policies> </Policies>
<DefaultRolloverStrategy max="10"/> <DefaultRolloverStrategy max="10"/>
</RollingFile> </RollingFile>
<RollingFile name="GWRollingError" fileName="${sys:jdchain.log}/gw.error.log"
filePattern="${sys:jdchain.log}/$${date:yyyy-MM}/gw.error-%d{yyyy-MM-dd}-%i.log">
<ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout pattern="[%date{yyyy-MM-dd HH:mm:ss:SSS}] [%thread] [%p] - %l - %m%n"/>
<Policies>
<TimeBasedTriggeringPolicy/>
<SizeBasedTriggeringPolicy size="100 MB"/>
</Policies>
</RollingFile>
</appenders> </appenders>


<loggers> <loggers>
@@ -22,6 +31,7 @@
<root level="all"> <root level="all">
<appender-ref ref="Console"/> <appender-ref ref="Console"/>
<appender-ref ref="GWRolling"/> <appender-ref ref="GWRolling"/>
<appender-ref ref="GWRollingError"/>
</root> </root>
</loggers> </loggers>
</configuration> </configuration>

+ 12
- 2
deploy/deploy-peer/src/main/resources/config/log4j2-peer.xml View File

@@ -2,18 +2,27 @@
<configuration status="WARN" monitorInterval="60"> <configuration status="WARN" monitorInterval="60">
<appenders> <appenders>
<console name="Console" target="SYSTEM_OUT"> <console name="Console" target="SYSTEM_OUT">
<ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/>
<ThresholdFilter level="all" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %class{36} %L %M - %msg%xEx%n"/> <PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %class{36} %L %M - %msg%xEx%n"/>
</console> </console>
<RollingFile name="PeerRolling" fileName="${sys:jdchain.log}/peer.log" <RollingFile name="PeerRolling" fileName="${sys:jdchain.log}/peer.log"
filePattern="${sys:jdchain.log}/$${date:yyyy-MM}/peer-%d{yyyy-MM-dd}-%i.log"> filePattern="${sys:jdchain.log}/$${date:yyyy-MM}/peer-%d{yyyy-MM-dd}-%i.log">
<PatternLayout pattern="[%d{HH:mm:ss:SSS}] [%p] - %l - %m%n"/>
<PatternLayout pattern="[%date{yyyy-MM-dd HH:mm:ss:SSS}] [%thread] [%p] - %l - %m%n"/>
<Policies> <Policies>
<TimeBasedTriggeringPolicy/> <TimeBasedTriggeringPolicy/>
<SizeBasedTriggeringPolicy size="250 MB"/> <SizeBasedTriggeringPolicy size="250 MB"/>
</Policies> </Policies>
<DefaultRolloverStrategy max="10"/> <DefaultRolloverStrategy max="10"/>
</RollingFile> </RollingFile>
<RollingFile name="PeerRollingError" fileName="${sys:jdchain.log}/peer.error.log"
filePattern="${sys:jdchain.log}/$${date:yyyy-MM}/peer.error-%d{yyyy-MM-dd}-%i.log">
<ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout pattern="[%date{yyyy-MM-dd HH:mm:ss:SSS}] [%thread] [%p] - %l - %m%n"/>
<Policies>
<TimeBasedTriggeringPolicy/>
<SizeBasedTriggeringPolicy size="100 MB"/>
</Policies>
</RollingFile>
</appenders> </appenders>


<loggers> <loggers>
@@ -22,6 +31,7 @@
<root level="all"> <root level="all">
<appender-ref ref="Console"/> <appender-ref ref="Console"/>
<appender-ref ref="PeerRolling"/> <appender-ref ref="PeerRolling"/>
<appender-ref ref="PeerRollingError"/>
</root> </root>
</loggers> </loggers>
</configuration> </configuration>

Loading…
Cancel
Save