I am working with Wildfly 10 and I am using its logging subsystem.
Now, I need to append the LoginName of the currently logged in User (principal) from the session to every log message that is processed by the JBoss Logging Subsystem.
Is there a generic way to do this, rather than appending the UserName to every Log Message in my Application?
For example i could do:
HttpServletRequest request = (HttpServletRequest)externalContext.getRequest();
UserModel user = (UserModel)request.getSession().getAttribute("user");
String username = user.getName();
But how can i get the Logging Subsystem to do this for every Log Message?