- for (Principal principal : subject.getPrincipals()) {
- msg.append(" Principal: " + principal.getName()).append(" (")
- .append(principal.getClass().getSimpleName()).append(")\n");
- }
- for (Object credential : subject.getPublicCredentials()) {
- msg.append(" Public Credential: " + credential).append(" (")
- .append(credential.getClass().getSimpleName()).append(")\n");
+ if (log.isTraceEnabled()) {
+ for (Principal principal : subject.getPrincipals()) {
+ msg.append(" Principal: " + principal.getName()).append(" (")
+ .append(principal.getClass().getSimpleName()).append(")\n");
+ }
+ for (Object credential : subject.getPublicCredentials()) {
+ msg.append(" Public Credential: " + credential).append(" (")
+ .append(credential.getClass().getSimpleName()).append(")\n");
+ }