Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
ARUHA-2199: fixed status code 102 reporting; check for null;
Browse files Browse the repository at this point in the history
  • Loading branch information
vstepanov committed Mar 4, 2019
1 parent 1721b14 commit dbae461
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/org/zalando/nakadi/filters/LoggingFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
import org.springframework.web.filter.OncePerRequestFilter;
import org.zalando.nakadi.plugin.api.authz.AuthorizationService;
Expand Down Expand Up @@ -79,7 +80,7 @@ private AsyncRequestListener(final HttpServletRequest request, final HttpServlet
this.flowId = flowId;

this.requestLogInfo = new RequestLogInfo(request, startTime);
logToAccessLog(this.requestLogInfo, this.response.getStatus(), 0L);
logToAccessLog(this.requestLogInfo, HttpStatus.PROCESSING.value(), 0L);
}

private void logOnEvent() {
Expand Down Expand Up @@ -163,8 +164,8 @@ private void logToAccessLog(final RequestLogInfo requestLogInfo, final int statu
}

private void traceRequest(final RequestLogInfo requestLogInfo, final int statusCode, final Long timeSpentMs) {
if ("POST".equals(requestLogInfo.method) && requestLogInfo.path.startsWith("/event-types/") &&
requestLogInfo.path.contains("/events")) {
if (requestLogInfo.path != null && "POST".equals(requestLogInfo.method) &&
requestLogInfo.path.startsWith("/event-types/") && requestLogInfo.path.contains("/events")) {

final String eventType = requestLogInfo.path.substring("/event-types/".length(),
requestLogInfo.path.lastIndexOf("/events"));
Expand Down

0 comments on commit dbae461

Please sign in to comment.