Repository: asterixdb
Updated Branches:
  refs/heads/master 93c8b4cdf -> bb8856004


[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]>


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/bb885600
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/bb885600
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/bb885600

Branch: refs/heads/master
Commit: bb885600431bd1c08bf8483ae830356856c62c03
Parents: 93c8b4c
Author: Abdullah Alamoudi <[email protected]>
Authored: Wed Aug 1 18:47:35 2018 -0700
Committer: abdullah alamoudi <[email protected]>
Committed: Wed Aug 1 21:12:31 2018 -0700

----------------------------------------------------------------------
 .../asterix/app/active/ActiveEntityEventsListener.java       | 2 ++
 .../org/apache/hyracks/http/server/HttpServerHandler.java    | 8 ++++----
 2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/bb885600/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/ActiveEntityEventsListener.java
----------------------------------------------------------------------
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 @@ public abstract class ActiveEntityEventsListener implements 
IActiveEntityControl
     @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 @@ public abstract class ActiveEntityEventsListener implements 
IActiveEntityControl
         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) {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/bb885600/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/HttpServerHandler.java
----------------------------------------------------------------------
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 @@ public class HttpServerHandler<T extends HttpServer> extends 
SimpleChannelInboun
                 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 @@ public class HttpServerHandler<T extends HttpServer> 
extends SimpleChannelInboun
     }
 
     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();
     }
 }

Reply via email to