Skip to content

Commit

Permalink
Fix log replay of the Log4j 2 appender (#10243)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanbisutti authored Jan 17, 2024
1 parent dbb8ab1 commit 9ec6401
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
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

0 comments on commit 9ec6401

Please sign in to comment.