Fix/jparolloutshandlerlogging (#1819)

Fix JpaExecutorHandler logging MDC context

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2024-08-13 09:30:09 +03:00
committed by GitHub
parent 9bb61fd829
commit 12928a5939
3 changed files with 8 additions and 10 deletions

View File

@@ -90,7 +90,7 @@ public class MDCHandler {
}
/**
* With logging throwing Runtime Exception (wihtLoggingRE). Calls the {@link #withLogging(Callable)} method and
* With logging throwing Runtime Exception (withLoggingRE). Calls the {@link #withLogging(Callable)} method and
* wraps any catchable exception into a {@link RuntimeException}.
*
* @param <T> the return type
@@ -111,7 +111,6 @@ public class MDCHandler {
final String user = springSecurityAuditorAware
.getCurrentAuditor()
.filter(username -> !username.equals("system")) // null and system are the same - system user
.map(username -> (securityContext != null && securityContext.isCurrentThreadSystemCode() ? "as " : "") + username)
.orElse(null);
final String currentUser = MDC.get(MDC_KEY_USER);