Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix log replay of the Log4j 2 appender #10243

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,6 @@ public B setOpenTelemetry(OpenTelemetry openTelemetry) {
@Override
public OpenTelemetryAppender build() {
OpenTelemetry openTelemetry = this.openTelemetry;
if (openTelemetry == null) {
openTelemetry = OpenTelemetry.noop();
}
return new OpenTelemetryAppender(
getName(),
getLayout(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import java.util.List;
import org.apache.logging.log4j.message.StringMapMessage;
import org.apache.logging.log4j.message.StructuredDataMessage;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

Expand All @@ -22,6 +23,10 @@ class LogReplayOpenTelemetryAppenderTest extends AbstractOpenTelemetryAppenderTe
@BeforeEach
void setup() {
generalBeforeEachSetup();
}

@AfterEach
void resetOpenTelemetry() {
OpenTelemetryAppender.install(null);
}

Expand Down
Loading