Skip to content

Commit

Permalink
add tenantId to each log lines (#810)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuqi-Du authored Jan 22, 2024
1 parent 40f9b49 commit 8929cc9
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;

@ApplicationScoped
public class MeteredCommandProcessor {
Expand Down Expand Up @@ -98,6 +99,7 @@ public MeteredCommandProcessor(
public <T extends Command> Uni<CommandResult> processCommand(
CommandContext commandContext, T command) {
Timer.Sample sample = Timer.start(meterRegistry);
MDC.put("tenantId", stargateRequestInfo.getTenantId().orElse(UNKNOWN_VALUE));
// start by resolving the command, get resolver
return commandProcessor
.processCommand(commandContext, command)
Expand Down

0 comments on commit 8929cc9

Please sign in to comment.