Skip to content

Commit

Permalink
#54 : Trace des perfs des ws
Browse files Browse the repository at this point in the history
  • Loading branch information
vzwingma committed Jul 18, 2024
1 parent 9ab2d0e commit 1c45bbf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public abstract class AbstractAPIInterceptors {
@Inject
IJwtSecurityContext securityContext;

private long startTime;
/**
* Logger requête
*
Expand All @@ -33,6 +34,8 @@ public void preMatchingFilter(ContainerRequestContext requestContext) {
String jwt = requestContext.getHeaderString(HttpHeaders.AUTHORIZATION);
LOG.debug("[HTTP] > [uri:{} {}]", requestContext.getMethod(), path);
LOG.trace("[HTTP] > [api-key:{}][jwt:{}]", apiKey, jwt);

startTime = System.currentTimeMillis();
}

/**
Expand All @@ -43,7 +46,7 @@ public void preMatchingFilter(ContainerRequestContext requestContext) {
public void postMatchingFilter(ContainerResponseContext responseContext) {

BusinessTraceContext.getclear();
LOG.debug("[HTTP] < [{} - {}]", responseContext.getStatus(), responseContext.getStatusInfo().getReasonPhrase());
LOG.debug("[HTTP] < [{} - {}][t:{} ms]", responseContext.getStatus(), responseContext.getStatusInfo().getReasonPhrase(), System.currentTimeMillis() - startTime);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ public abstract class AbstractAPISecurityFilter implements ContainerRequestFilte
*/
@Override
public void filter(ContainerRequestContext requestContext) {


String apiKey = requestContext.getHeaders().getFirst(HTTP_HEADER_API_KEY);
String rawJWTToken = getAuthBearerFromHeaders(requestContext.getHeaders().getFirst(HttpHeaders.AUTHORIZATION.toLowerCase(Locale.ROOT)));

Expand Down

0 comments on commit 1c45bbf

Please sign in to comment.