File tree 3 files changed +13
-11
lines changed
3 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -49,5 +49,15 @@ application {
49
49
tasks.named<JavaExec >(" run" ) {
50
50
doFirst {
51
51
jvmArgs(" -javaagent:${agent.singleFile} " )
52
+ // log4j-appender properties
53
+ jvmArgs(
54
+ " -Dotel.instrumentation.log4j-appender.experimental.capture-map-message-attributes=true" ,
55
+ " -Dotel.instrumentation.log4j-appender.experimental-log-attributes=true"
56
+ )
57
+ // logback-appender properties
58
+ jvmArgs(
59
+ " -Dotel.instrumentation.logback-appender.experimental-log-attributes=true" ,
60
+ " -Dotel.instrumentation.logback-appender.experimental.capture-key-value-pair-attributes=true"
61
+ )
52
62
}
53
63
}
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" UTF-8" ?>
2
- <Configuration status =" WARN" packages = " io.opentelemetry.instrumentation.log4j.appender.v2_17 " >
2
+ <Configuration status =" WARN" >
3
3
<Appenders >
4
4
<Console name =" ConsoleAppender" target =" SYSTEM_OUT" follow =" true" >
5
5
<PatternLayout pattern =" log4j2: %d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" />
6
6
</Console >
7
- <OpenTelemetry name =" OpenTelemetryAppender" captureMapMessageAttributes =" true" captureExperimentalAttributes =" true" />
8
7
</Appenders >
9
8
<Loggers >
10
9
<Root level =" info" >
11
- <AppenderRef ref =" OpenTelemetryAppender" />
12
10
<AppenderRef ref =" ConsoleAppender" />
13
11
</Root >
14
12
</Loggers >
15
- </Configuration >
13
+ </Configuration >
Original file line number Diff line number Diff line change 7
7
</pattern >
8
8
</encoder >
9
9
</appender >
10
- <appender name =" OpenTelemetry"
11
- class =" io.opentelemetry.instrumentation.logback.appender.v1_0.OpenTelemetryAppender" >
12
- <captureExperimentalAttributes >true</captureExperimentalAttributes >
13
- <captureKeyValuePairAttributes >true</captureKeyValuePairAttributes >
14
- </appender >
15
10
<root level =" INFO" >
16
11
<appender-ref ref =" console" />
17
- <appender-ref ref =" OpenTelemetry" />
18
12
</root >
19
- </configuration >
13
+ </configuration >
You can’t perform that action at this time.
0 commit comments