-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
InstrumentationConfig part 5: library logging appenders (open-telemet…
…ry#6321) * InstrumentationConfig part 5: library logging appenders * Logback * remove log4j hackery * fix tests * Remove unused Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
- Loading branch information
Showing
13 changed files
with
200 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...a/io/opentelemetry/javaagent/instrumentation/logback/appender/v1_0/LogbackSingletons.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.javaagent.instrumentation.logback.appender.v1_0; | ||
|
||
import static java.util.Collections.emptyList; | ||
|
||
import io.opentelemetry.instrumentation.logback.appender.v1_0.internal.LoggingEventMapper; | ||
import io.opentelemetry.javaagent.bootstrap.internal.InstrumentationConfig; | ||
import java.util.List; | ||
|
||
public class LogbackSingletons { | ||
|
||
private static final LoggingEventMapper mapper; | ||
|
||
static { | ||
InstrumentationConfig config = InstrumentationConfig.get(); | ||
|
||
boolean captureExperimentalAttributes = | ||
config.getBoolean( | ||
"otel.instrumentation.logback-appender.experimental-log-attributes", false); | ||
List<String> captureMdcAttributes = | ||
config.getList( | ||
"otel.instrumentation.logback-appender.experimental.capture-mdc-attributes", | ||
emptyList()); | ||
|
||
mapper = new LoggingEventMapper(captureExperimentalAttributes, captureMdcAttributes); | ||
} | ||
|
||
public static LoggingEventMapper mapper() { | ||
return mapper; | ||
} | ||
} |
Oops, something went wrong.