Last modified by Jean-Claude ALLETRU on 2024/08/20 10:22

Hide last authors
Jean-Claude ALLETRU 1.1 1
2
3 {{code language="xml" title="Exemple d'appender redis pour log4j2 qui envoie des json_event utilisables par logstash" language="xml"}}
4 <RedisAppender name="REDIS" key="rd_xxxxxx_prod"
5 host="vmxxxxxxxxxxxx.hardis.fr" port="6379"
6 password="xxxxxxxxxxxxx"
7 ignoreExceptions="true">
8
9 <JsonTemplateLayout eventTemplateUri="classpath:LogstashJsonEventLayoutV1.json" locationInfoEnabled="true">
10 <EventTemplateAdditionalField key="monchamp1" value="mavaleur1"/>
11 <EventTemplateAdditionalField key="monchamp2" value="mavaleur2"/>
12 <EventTemplateAdditionalField key="monchamp3" value="mavaleur3"/>
13 </JsonTemplateLayout>
14
15 <RedisConnectionPoolConfig testWhileIdle="true"
16 minEvictableIdleTimeMillis="60000"
17 timeBetweenEvictionRunsMillis="30000"
18 numTestsPerEvictionRun="-1"/>
19
20 <RedisThrottlerConfig bufferSize="5000"
21 batchSize="50"
22 flushPeriodMillis="2000"
23 maxEventCountPerSecond="unlimited"
24 maxByteCountPerSecond="unlimited"
25 maxErrorCountPerSecond="0.003"/>
26 </RedisAppender>
27 {{/code}}
28
29
30
31
32
33 Pour plus d'information sur les paramètres propres à l'appender redis voir : [[https://github.com/vy/log4j2-redis-appender>>url:https://github.com/vy/log4j2-redis-appender]]
34
35 Pour plus d'information sur le JsonTemplateLayout voir : [[https://logging.apache.org/log4j/2.x/manual/json-template-layout.html>>url:https://logging.apache.org/log4j/2.x/manual/json-template-layout.html]]
36
37
38
39
40