abdullah alamoudi has submitted this change and it was merged. Change subject: [NO ISSUE] Improve logging for Http server ......................................................................
[NO ISSUE] Improve logging for Http server - user model changes: no - storage format changes: no - interface changes: no Details: - Reduce logging level for failures in HttpServerHandler. - Log as an error failures during active jobs. Change-Id: I7474a93e869df1cbf5dbb00d16acbe2d4bfaa6e0 Reviewed-on: https://asterix-gerrit.ics.uci.edu/2834 Reviewed-by: Murtadha Hubail <[email protected]> Sonar-Qube: Jenkins <[email protected]> Tested-by: Jenkins <[email protected]> Contrib: Jenkins <[email protected]> Integration-Tests: Jenkins <[email protected]> --- M asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/ActiveEntityEventsListener.java M hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/HttpServerHandler.java 2 files changed, 6 insertions(+), 4 deletions(-) Approvals: Anon. E. Moose #1000171: Jenkins: Verified; No violations found; ; Verified Murtadha Hubail: Looks good to me, approved diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/ActiveEntityEventsListener.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/ActiveEntityEventsListener.java index be43a4e..345080c 100644 --- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/ActiveEntityEventsListener.java +++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/ActiveEntityEventsListener.java @@ -191,6 +191,7 @@ @SuppressWarnings("unchecked") protected void finish(ActiveEvent event) throws HyracksDataException { LOGGER.log(level, "the job " + jobId + " finished"); + JobId lastJobId = jobId; if (numRegistered != numDeRegistered) { LOGGER.log(Level.WARN, "the job {} finished with reported runtime registrations = {} and deregistrations = {}", jobId, @@ -204,6 +205,7 @@ if (!jobSuccessfullyTerminated(jobStatus)) { jobFailure = exceptions.isEmpty() ? new RuntimeDataException(ErrorCode.UNREPORTED_TASK_FAILURE_EXCEPTION) : exceptions.get(0); + LOGGER.error("Active Job {} failed", lastJobId, jobFailure); setState((state == ActivityState.STOPPING || state == ActivityState.CANCELLING) ? ActivityState.STOPPED : ActivityState.TEMPORARILY_FAILED); if (prevState == ActivityState.RUNNING) { diff --git a/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/HttpServerHandler.java b/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/HttpServerHandler.java index 7b3d18a..baa664a 100644 --- a/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/HttpServerHandler.java +++ b/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/HttpServerHandler.java @@ -91,7 +91,7 @@ submit(ctx, servlet, request); } } catch (Exception e) { - LOGGER.log(Level.ERROR, "Failure Submitting HTTP Request", e); + LOGGER.log(Level.WARN, "Failure Submitting HTTP Request", e); respond(ctx, request.protocolVersion(), new HttpResponseStatus(500, e.getMessage())); } } @@ -125,15 +125,15 @@ } protected void handleServletNotFound(ChannelHandlerContext ctx, FullHttpRequest request) { - if (LOGGER.isWarnEnabled()) { - LOGGER.warn("No servlet for " + request.uri()); + if (LOGGER.isDebugEnabled()) { + LOGGER.debug("No servlet for " + request.uri()); } respond(ctx, request.protocolVersion(), HttpResponseStatus.NOT_FOUND); } @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { - LOGGER.log(Level.ERROR, "Failure handling HTTP Request", cause); + LOGGER.log(Level.WARN, "Failure handling HTTP Request", cause); ctx.close(); } } -- To view, visit https://asterix-gerrit.ics.uci.edu/2834 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7474a93e869df1cbf5dbb00d16acbe2d4bfaa6e0 Gerrit-PatchSet: 2 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: abdullah alamoudi <[email protected]> Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Murtadha Hubail <[email protected]> Gerrit-Reviewer: abdullah alamoudi <[email protected]>
