Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Improve logging (v3) #3970

Open
wants to merge 3 commits into
base: v3.x.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api-catalog-services/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ logging:
org.apache: INFO
org.apache.http: DEBUG
org.apache.tomcat.util.net: DEBUG
org.apache.tomcat.util.net.jsse.JSSESupport: INFO
com.netflix: INFO
org.ehcache: INFO
com.netflix.discovery.shared.transport.decorator: DEBUG
Expand Down
1 change: 1 addition & 0 deletions caching-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,6 @@ logging:
level:
ROOT: INFO
org.apache.tomcat.util.net: DEBUG
org.apache.tomcat.util.net.jsse.JSSESupport: INFO
org.jgroups: DEBUG
org.infinispan: DEBUG
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ public ErrorCode getErrorCode() {
}

protected String getMessage(String baseMessage) {
return baseMessage + ' ' + getErrorCode().getMessage();
return String.format("%s %s: safRc=%d, racfRc=%d, racfRsn=%d",
baseMessage, getErrorCode().getMessage(),
this.safRc, this.racfRc, this.racfRsn
);
}

public int getHttpStatus() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

package org.zowe.apiml.passticket;

import org.zowe.apiml.util.ClassOrDefaultProxyUtils;
import org.zowe.apiml.util.ObjectUtil;
import lombok.AllArgsConstructor;
import lombok.Value;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.zowe.apiml.util.ClassOrDefaultProxyUtils;
import org.zowe.apiml.util.ObjectUtil;

import java.util.HashMap;
import java.util.HashSet;
Expand All @@ -25,6 +25,7 @@
/**
* This class allows to get a PassTicket from SAF.
*/
@Slf4j
public class PassTicketService {

private final IRRPassTicket irrPassTicket;
Expand All @@ -47,7 +48,12 @@ public synchronized void evaluate(String userId, String applId, String passTicke

// IRRPassTicket is not thread-safe, must be synchronized
public synchronized String generate(String userId, String applId) throws IRRPassTicketGenerationException {
return irrPassTicket.generate(userId.toUpperCase(), applId.toUpperCase());
try {
return irrPassTicket.generate(userId.toUpperCase(), applId.toUpperCase());
} catch (IRRPassTicketGenerationException | RuntimeException e) {
log.debug("Error during pass ticket generation, userId={}, applid={}, exception={}", userId, applId, e);
throw e;
}
}

public boolean isUsingSafImplementation() {
Expand Down
1 change: 1 addition & 0 deletions discovery-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ logging:
org.apache: INFO
org.apache.http: DEBUG
org.apache.tomcat.util.net: DEBUG
org.apache.tomcat.util.net.jsse.JSSESupport: INFO
com.netflix: INFO
com.sun.jersey.server.impl.application.WebApplicationImpl: INFO
org.ehcache: INFO
Expand Down
1 change: 1 addition & 0 deletions gateway-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ logging:
reactor.netty.http.client.HttpClientConnect: DEBUG
com.netflix: DEBUG
org.apache.tomcat.util.net: DEBUG
org.apache.tomcat.util.net.jsse.JSSESupport: INFO
javax.net.ssl: ERROR

---
Expand Down
1 change: 1 addition & 0 deletions zaas-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ logging:
org.apache: INFO
org.apache.http: DEBUG
org.apache.tomcat.util.net: DEBUG
org.apache.tomcat.util.net.jsse.JSSESupport: INFO
com.netflix: DEBUG
org.hibernate: INFO
org.springframework.web.servlet.PageNotFound: WARN
Expand Down
Loading