Skip to content

Commit e18da5c

Browse files
authored
feat: add log4j2 configuration (#214)
1 parent 2c53299 commit e18da5c

File tree

4 files changed

+69
-0
lines changed

4 files changed

+69
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ target/
2323
!**/src/main/**/target/
2424
!**/src/test/**/target/
2525
release/
26+
logs/
2627

2728
### IntelliJ IDEA ###
2829
.idea

pom.xml

+5
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@
8888
<type>pom</type>
8989
<scope>import</scope>
9090
</dependency>
91+
<dependency>
92+
<groupId>com.lmax</groupId>
93+
<artifactId>disruptor</artifactId>
94+
<version>3.4.4</version>
95+
</dependency>
9196
<dependency>
9297
<groupId>org.springframework.boot</groupId>
9398
<artifactId>spring-boot-dependencies</artifactId>

runner-core/pom.xml

+4
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@
6363
</exclusion>
6464
</exclusions>
6565
</dependency>
66+
<dependency>
67+
<groupId>com.lmax</groupId>
68+
<artifactId>disruptor</artifactId>
69+
</dependency>
6670
<dependency>
6771
<groupId>io.netty</groupId>
6872
<artifactId>netty-all</artifactId>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Licensed to the Apache Software Foundation (ASF) under one or more
4+
~ contributor license agreements. See the NOTICE file distributed with
5+
~ this work for additional information regarding copyright ownership.
6+
~ The ASF licenses this file to You under the Apache License, Version 2.0
7+
~ (the "License"); you may not use this file except in compliance with
8+
~ the License. You may obtain a copy of the License at
9+
~
10+
~ http://www.apache.org/licenses/LICENSE-2.0
11+
~
12+
~ Unless required by applicable law or agreed to in writing, software
13+
~ distributed under the License is distributed on an "AS IS" BASIS,
14+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
~ See the License for the specific language governing permissions and
16+
~ limitations under the License.
17+
~
18+
-->
19+
20+
<configuration status="OFF">
21+
22+
<Properties>
23+
<Property name="LOG_LEVEL">debug</Property>
24+
<Property name="USER_DIR">${sys:user.dir}</Property>
25+
<Property name="FILE_ENCODING">${sys:file.encoding}</Property>
26+
</Properties>
27+
28+
<Appenders>
29+
<RollingFile name="ERROR-APPENDER" fileName="${USER_DIR}/logs/java-runner-common-error.log" append="true"
30+
filePattern="${USER_DIR}/logs/java-runner-common-error.log.%d{yyyy-MM-dd}">
31+
<!-- only print error log -->
32+
<ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/>
33+
<PatternLayout charset="${FILE_ENCODING}">
34+
<pattern>%d %-5p %-32t - %m%n %throwable</pattern>
35+
</PatternLayout>
36+
<Policies>
37+
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
38+
</Policies>
39+
</RollingFile>
40+
41+
<RollingFile name="ROOT-APPENDER" fileName="${USER_DIR}/logs/java-runner-common-default.log" append="true"
42+
filePattern="${USER_DIR}/logs/java-runner-common-default.log.%d{yyyy-MM-dd}">
43+
<ThresholdFilter level="debug" onMatch="ACCEPT" onMismatch="DENY"/>
44+
<PatternLayout charset="${FILE_ENCODING}">
45+
<pattern>%d %-5p %-32t - %m%n %throwable</pattern>
46+
</PatternLayout>
47+
<Policies>
48+
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
49+
</Policies>
50+
</RollingFile>
51+
</Appenders>
52+
53+
<Loggers>
54+
<AsyncRoot level="${LOG_LEVEL}">
55+
<appender-ref ref="ROOT-APPENDER"/>
56+
<appender-ref ref="ERROR-APPENDER"/>
57+
</AsyncRoot>
58+
</Loggers>
59+
</configuration>

0 commit comments

Comments
 (0)