cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [2/2] git commit: less info logs in transports/websocket
Date Wed, 29 Oct 2014 22:10:57 GMT
less info logs in transports/websocket


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

Branch: refs/heads/3.0.x-fixes
Commit: 9eeac308675134514cb4c7167b7227ec6891a2d5
Parents: 37c01ad
Author: Akitoshi Yoshida <ay@apache.org>
Authored: Wed Oct 29 23:02:59 2014 +0100
Committer: Akitoshi Yoshida <ay@apache.org>
Committed: Wed Oct 29 23:08:54 2014 +0100

----------------------------------------------------------------------
 .../websocket/WebSocketVirtualServletRequest.java     | 14 ++++++++++----
 .../transport/websocket/ahc/AhcWebSocketConduit.java  | 14 +++++++-------
 .../atmosphere/AtmosphereWebSocketHandler.java        |  4 ++--
 .../cxf/transport/websocket/jetty/JettyWebSocket.java |  8 ++++----
 4 files changed, 23 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/9eeac308/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/WebSocketVirtualServletRequest.java
----------------------------------------------------------------------
diff --git a/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/WebSocketVirtualServletRequest.java
b/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/WebSocketVirtualServletRequest.java
index a4a1328..729ab44 100644
--- a/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/WebSocketVirtualServletRequest.java
+++ b/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/WebSocketVirtualServletRequest.java
@@ -333,7 +333,9 @@ public class WebSocketVirtualServletRequest implements HttpServletRequest
{
 
     @Override
     public String getContextPath() {
-        LOG.log(Level.FINE, "getContextPath -> " + webSocketHolder.getContextPath());
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.log(Level.FINE, "getContextPath -> " + webSocketHolder.getContextPath());
+        }
         return webSocketHolder.getContextPath();
     }
 
@@ -397,8 +399,10 @@ public class WebSocketVirtualServletRequest implements HttpServletRequest
{
     public String getPathInfo() {
         LOG.log(Level.INFO, "getPathInfo");
         String uri = requestHeaders.get(WebSocketUtils.URI_KEY);
-        String servletpath = webSocketHolder.getServletPath();       
-        LOG.log(Level.FINE, "getPathInfo " + servletpath + " " + uri);
+        String servletpath = webSocketHolder.getServletPath(); 
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.log(Level.FINE, "getPathInfo " + servletpath + " " + uri);
+        }
         //TODO remove the query string part
         //REVISIT may cache this value in requstHeaders?
         return uri.substring(servletpath.length());
@@ -434,7 +438,9 @@ public class WebSocketVirtualServletRequest implements HttpServletRequest
{
 
     @Override
     public String getRequestURI() {
-        LOG.log(Level.FINE, "getRequestURI " + requestHeaders.get(WebSocketUtils.URI_KEY));
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.log(Level.FINE, "getRequestURI " + requestHeaders.get(WebSocketUtils.URI_KEY));
+        }
         return requestHeaders.get(WebSocketUtils.URI_KEY);
     }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/9eeac308/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/ahc/AhcWebSocketConduit.java
----------------------------------------------------------------------
diff --git a/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/ahc/AhcWebSocketConduit.java
b/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/ahc/AhcWebSocketConduit.java
index c243d9d..68d6407 100644
--- a/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/ahc/AhcWebSocketConduit.java
+++ b/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/ahc/AhcWebSocketConduit.java
@@ -267,18 +267,18 @@ public class AhcWebSocketConduit extends URLConnectionHTTPConduit {
         //
 
         protected void connect() {
-            LOG.log(Level.INFO, "connecting");
+            LOG.log(Level.FINE, "connecting");
             if (websocket == null) {
                 try {
                     websocket = ahcclient.prepareGet(url.toASCIIString()).execute(
                             new WebSocketUpgradeHandler.Builder()
                             .addWebSocketListener(new AhcWebSocketListener()).build()).get();
-                    LOG.log(Level.INFO, "connected");
+                    LOG.log(Level.FINE, "connected");
                 } catch (Exception e) {
                     LOG.log(Level.SEVERE, "unable to connect", e);
                 }
             } else {
-                LOG.log(Level.INFO, "already connected");
+                LOG.log(Level.FINE, "already connected");
             }
         }
 
@@ -309,14 +309,14 @@ public class AhcWebSocketConduit extends URLConnectionHTTPConduit {
     protected class AhcWebSocketListener implements WebSocketTextListener, WebSocketByteListener
{
 
         public void onOpen(WebSocket ws) {
-            if (LOG.isLoggable(Level.INFO)) {
-                LOG.log(Level.INFO, "onOpen({0})", ws);
+            if (LOG.isLoggable(Level.FINE)) {
+                LOG.log(Level.FINE, "onOpen({0})", ws);
             }
         }
 
         public void onClose(WebSocket ws) {
-            if (LOG.isLoggable(Level.INFO)) {
-                LOG.log(Level.INFO, "onCose({0})", ws);
+            if (LOG.isLoggable(Level.FINE)) {
+                LOG.log(Level.FINE, "onCose({0})", ws);
             }
         }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/9eeac308/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/AtmosphereWebSocketHandler.java
----------------------------------------------------------------------
diff --git a/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/AtmosphereWebSocketHandler.java
b/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/AtmosphereWebSocketHandler.java
index 791fa66..776741e 100644
--- a/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/AtmosphereWebSocketHandler.java
+++ b/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/AtmosphereWebSocketHandler.java
@@ -148,13 +148,13 @@ public class AtmosphereWebSocketHandler implements WebSocketProtocol
{
     /** {@inheritDoc}*/
     @Override
     public void onOpen(WebSocket webSocket) {
-        LOG.info("onOpen(WebSocket)");
+        LOG.fine("onOpen(WebSocket)");
     }
 
     /** {@inheritDoc}*/
     @Override
     public void onClose(WebSocket webSocket) {
-        LOG.info("onClose(WebSocket)");
+        LOG.fine("onClose(WebSocket)");
         
     }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/9eeac308/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/jetty/JettyWebSocket.java
----------------------------------------------------------------------
diff --git a/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/jetty/JettyWebSocket.java
b/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/jetty/JettyWebSocket.java
index 822f9ed..5bab332 100644
--- a/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/jetty/JettyWebSocket.java
+++ b/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/jetty/JettyWebSocket.java
@@ -66,16 +66,16 @@ class JettyWebSocket implements WebSocket.OnBinaryMessage, WebSocket.OnTextMessa
 
     @Override
     public void onClose(int closeCode, String message) {
-        if (LOG.isLoggable(Level.INFO)) {
-            LOG.log(Level.INFO, "onClose({0}, {1})", new Object[]{closeCode, message});
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.log(Level.FINE, "onClose({0}, {1})", new Object[]{closeCode, message});
         }
         this.webSocketConnection = null;
     }
 
     @Override
     public void onOpen(Connection connection) {
-        if (LOG.isLoggable(Level.INFO)) {
-            LOG.log(Level.INFO, "onOpen({0}))", connection);
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.log(Level.FINE, "onOpen({0}))", connection);
         }
         this.webSocketConnection = connection;
     }


Mime
View raw message