Skip to content

Commit 98fae76

Browse files
committed
Always write scope + do not filter if not in lazy mode
1 parent 0687556 commit 98fae76

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

appender/src/main/java/no/entur/logging/cloud/appender/scope/DefaultLoggingScope.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ public DefaultLoggingScope(Predicate<ILoggingEvent> queuePredicate, Predicate<IL
3232

3333
@Override
3434
public Queue<ILoggingEvent> getEvents() {
35-
if(!failure) {
35+
if(flushMode == LoggingScopeFlushMode.LAZY && !failure) {
36+
// filter unwanted events
3637
events.removeIf(queuePredicate);
3738
}
3839

on-demand/on-demand-spring-boot-starter-grpc/src/main/java/no/entur/logging/cloud/spring/ondemand/grpc/scope/GrpcLoggingScopeContextInterceptor.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,7 @@ public void close(Status status, Metadata trailers) {
118118
scope.failure();
119119
}
120120

121-
if(scope.isFailure()) {
122-
sink.write(scope);
123-
}
121+
sink.write(scope);
124122
} finally {
125123
factory.closeScope(scope); // this is really a noop operation
126124
}

0 commit comments

Comments
 (0)