forked from aliyun/aliyun-log-log4j2-appender
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlog4j2-example.xml
68 lines (67 loc) · 2.63 KB
/
log4j2-example.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<Appenders>
<Loghub name="loghubAppender1"
project="test-proj"
logStore="store1"
endpoint=""
accessKeyId=""
accessKeySecret=""
totalSizeInBytes="104857600"
maxBlockMs="60000"
ioThreadCount="8"
batchSizeThresholdInBytes="524288"
batchCountThreshold="4096"
lingerMs="2000"
retries="10"
baseRetryBackoffMs="100"
maxRetryBackoffMs="100"
topic="topic1"
source="source1"
timeFormat="yyyy-MM-dd'T'HH:mm:ssZ"
timeZone="UTC"
ignoreExceptions="true">
</Loghub>
<Loghub name="loghubAppender2"
project="test-proj"
logStore="store2"
endpoint=""
accessKeyId=""
accessKeySecret=""
totalSizeInBytes="104857600"
maxBlockMs="60000"
ioThreadCount="8"
batchSizeThresholdInBytes="524288"
batchCountThreshold="4096"
lingerMs="2000"
retries="10"
baseRetryBackoffMs="100"
maxRetryBackoffMs="100"
topic="topic2"
source="source2"
timeFormat="yyyy-MM-dd'T'HH:mm:ssZ"
timeZone="Asia/Shanghai"
ignoreExceptions="true">
<PatternLayout
pattern="%d{HH:mm:ss.SSS} %-5level %class{36} %L %M - %msg%xEx"/>
<Filters>
<!-- Now deny warn, error and fatal messages -->
<ThresholdFilter level="warn" onMatch="DENY" onMismatch="NEUTRAL"/>
<ThresholdFilter level="error" onMatch="DENY" onMismatch="NEUTRAL"/>
<ThresholdFilter level="fatal" onMatch="DENY" onMismatch="NEUTRAL"/>
<!-- This filter accepts info, warn, error, fatal and denies debug/trace -->
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
</Filters>
</Loghub>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
</Console>
</Appenders>
<Loggers>
<Root level="DEBUG">
<AppenderRef ref="loghubAppender1" level="WARN"/>
<AppenderRef ref="loghubAppender2"/>
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>