Skip to content

Commit 15bc46c

Browse files
committed
task: configure log4j2 with json logging
1 parent 1c3d46d commit 15bc46c

3 files changed

Lines changed: 24 additions & 18 deletions

File tree

examples/cli-example/build.gradle.kts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,9 @@ jib {
4040
dependencies {
4141
implementation("io.getunleash:unleash-client-java:11.2.0-SNAPSHOT")
4242
implementation("org.slf4j:slf4j-api:2.0.17")
43-
implementation("ch.qos.logback:logback-classic:1.5.20")
43+
runtimeOnly("org.apache.logging.log4j:log4j-core:2.25.2")
44+
runtimeOnly("org.apache.logging.log4j:log4j-api:2.25.2")
45+
runtimeOnly("org.apache.logging.log4j:log4j-slf4j2-impl:2.25.2")
46+
runtimeOnly("org.apache.logging.log4j:log4j-layout-template-json:2.25.2")
47+
runtimeOnly("com.fasterxml.jackson.core:jackson-databind:2.20.1")
4448
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Configuration xmlns="https://logging.apache.org/xml/ns"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="
4+
https://logging.apache.org/xml/ns
5+
https://logging.apache.org/xml/ns/log4j-config-2.xsd">
6+
7+
<Appenders>
8+
<Console name="CONSOLE">
9+
<JsonTemplateLayout />
10+
</Console>
11+
</Appenders>
12+
13+
<Loggers>
14+
<Root level="INFO">
15+
<AppenderRef ref="CONSOLE"/>
16+
</Root>
17+
</Loggers>
18+
19+
</Configuration>

examples/cli-example/src/main/resources/logback.xml

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)