hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1087363 - in /httpcomponents/httpclient/branches/4.1.x: ./ httpclient-cache/ httpclient-cache/src/main/java/org/apache/http/client/cache/ httpclient-cache/src/main/java/org/apache/http/impl/client/cache/ httpclient-contrib/src/main/java/or...
Date Thu, 31 Mar 2011 16:22:52 GMT
Author: jonm
Date: Thu Mar 31 16:22:52 2011
New Revision: 1087363

URL: http://svn.apache.org/viewvc?rev=1087363&view=rev
Log:
Reduced severity of several logging statements in the caching module so
as to reduce verbosity when the recommended DEBUG-level wire logging
settings are on. (backport of r1087358 from trunk to 4.1.x branch)

Modified:
    httpcomponents/httpclient/branches/4.1.x/   (props changed)
    httpcomponents/httpclient/branches/4.1.x/httpclient-cache/   (props changed)
    httpcomponents/httpclient/branches/4.1.x/httpclient-cache/src/main/java/org/apache/http/client/cache/HttpCacheStorage.java
  (props changed)
    httpcomponents/httpclient/branches/4.1.x/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/BasicHttpCacheStorage.java
  (props changed)
    httpcomponents/httpclient/branches/4.1.x/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheableRequestPolicy.java
    httpcomponents/httpclient/branches/4.1.x/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachedResponseSuitabilityChecker.java
    httpcomponents/httpclient/branches/4.1.x/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingHttpClient.java
    httpcomponents/httpclient/branches/4.1.x/httpclient-contrib/src/main/java/org/apache/http/contrib/auth/BouncySpnegoTokenGenerator.java
  (props changed)
    httpcomponents/httpclient/branches/4.1.x/httpclient/src/test/resources/test.keystore 
 (props changed)
    httpcomponents/httpclient/branches/4.1.x/src/docbkx/resources/   (props changed)

Propchange: httpcomponents/httpclient/branches/4.1.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 31 16:22:52 2011
@@ -1,3 +1,4 @@
 /httpcomponents/httpclient/branches/4.0.x:950681-950688
 /httpcomponents/httpclient/branches/branch_4_1:755593-811107
 /httpcomponents/httpclient/branches/notice-plugin-test:1024348-1031454
+/httpcomponents/httpclient/trunk:1087358

Propchange: httpcomponents/httpclient/branches/4.1.x/httpclient-cache/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 31 16:22:52 2011
@@ -1,4 +1,4 @@
 /httpcomponents/httpclient/branches/4.0.x/httpclient-cache:950681-950688
 /httpcomponents/httpclient/branches/branch_4_1/httpclient-cache:755593-811107
 /httpcomponents/httpclient/branches/notice-plugin-test/httpclient-cache:1024348-1031454
-/httpcomponents/httpclient/trunk/httpclient-cache:1080419,1080422,1080575,1084590,1084607,1084610-1084611,1084649,1084655
+/httpcomponents/httpclient/trunk/httpclient-cache:1080419,1080422,1080575,1084590,1084607,1084610-1084611,1084649,1084655,1087358

Propchange: httpcomponents/httpclient/branches/4.1.x/httpclient-cache/src/main/java/org/apache/http/client/cache/HttpCacheStorage.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 31 16:22:52 2011
@@ -1,3 +1,3 @@
 /httpcomponents/httpclient/branches/4.0.x/httpclient-cache/src/main/java/org/apache/http/client/cache/HttpCache.java:950681-950688
 /httpcomponents/httpclient/branches/branch_4_1/httpclient-cache/src/main/java/org/apache/http/client/cache/HttpCache.java:755593-811107
-/httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/client/cache/HttpCacheStorage.java:1080419,1080422,1080575,1084590,1084607,1084610-1084611,1084649,1084655
+/httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/client/cache/HttpCacheStorage.java:1080419,1080422,1080575,1084590,1084607,1084610-1084611,1084649,1084655,1087358

Propchange: httpcomponents/httpclient/branches/4.1.x/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/BasicHttpCacheStorage.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 31 16:22:52 2011
@@ -1,3 +1,3 @@
 /httpcomponents/httpclient/branches/4.0.x/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/BasicHttpCache.java:950681-950688
 /httpcomponents/httpclient/branches/branch_4_1/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/BasicHttpCache.java:755593-811107
-/httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/BasicHttpCacheStorage.java:1080419,1080422,1080575,1084590,1084607,1084610-1084611,1084649,1084655
+/httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/BasicHttpCacheStorage.java:1080419,1080422,1080575,1084590,1084607,1084610-1084611,1084649,1084655,1087358

Modified: httpcomponents/httpclient/branches/4.1.x/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheableRequestPolicy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.1.x/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheableRequestPolicy.java?rev=1087363&r1=1087362&r2=1087363&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.1.x/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheableRequestPolicy.java
(original)
+++ httpcomponents/httpclient/branches/4.1.x/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheableRequestPolicy.java
Thu Mar 31 16:22:52 2011
@@ -58,17 +58,17 @@ class CacheableRequestPolicy {
 
         ProtocolVersion pv = request.getRequestLine().getProtocolVersion();
         if (HttpVersion.HTTP_1_1.compareToVersion(pv) != 0) {
-            log.debug("Request was not serveable from cache");
+            log.trace("non-HTTP/1.1 request was not serveable from cache");
             return false;
         }
 
         if (!method.equals(HeaderConstants.GET_METHOD)) {
-            log.debug("Request was not serveable from cache");
+            log.trace("non-GET request was not serveable from cache");
             return false;
         }
 
         if (request.getHeaders(HeaderConstants.PRAGMA).length > 0) {
-            log.debug("Request was not serveable from cache");
+            log.trace("request with Pragma header was not serveable from cache");
             return false;
         }
 
@@ -77,19 +77,19 @@ class CacheableRequestPolicy {
             for (HeaderElement cacheControlElement : cacheControl.getElements()) {
                 if (HeaderConstants.CACHE_CONTROL_NO_STORE.equalsIgnoreCase(cacheControlElement
                         .getName())) {
-                    log.debug("Request was not serveable from Cache");
+                    log.trace("Request with no-store was not serveable from cache");
                     return false;
                 }
 
                 if (HeaderConstants.CACHE_CONTROL_NO_CACHE.equalsIgnoreCase(cacheControlElement
                         .getName())) {
-                    log.debug("Request was not serveable from cache");
+                    log.trace("Request with no-cache was not serveable from cache");
                     return false;
                 }
             }
         }
 
-        log.debug("Request was serveable from cache");
+        log.trace("Request was serveable from cache");
         return true;
     }
 

Modified: httpcomponents/httpclient/branches/4.1.x/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachedResponseSuitabilityChecker.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.1.x/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachedResponseSuitabilityChecker.java?rev=1087363&r1=1087362&r2=1087363&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.1.x/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachedResponseSuitabilityChecker.java
(original)
+++ httpcomponents/httpclient/branches/4.1.x/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachedResponseSuitabilityChecker.java
Thu Mar 31 16:22:52 2011
@@ -129,7 +129,7 @@ class CachedResponseSuitabilityChecker {
      */
     public boolean canCachedResponseBeUsed(HttpHost host, HttpRequest request, HttpCacheEntry
entry, Date now) {
         if (!isFreshEnough(entry, request, now)) {
-            log.debug("Cache entry was not fresh enough");
+            log.trace("Cache entry was not fresh enough");
             return false;
         }
 
@@ -150,12 +150,12 @@ class CachedResponseSuitabilityChecker {
         for (Header ccHdr : request.getHeaders(HeaderConstants.CACHE_CONTROL)) {
             for (HeaderElement elt : ccHdr.getElements()) {
                 if (HeaderConstants.CACHE_CONTROL_NO_CACHE.equals(elt.getName())) {
-                    log.debug("Response contained NO CACHE directive, cache was not suitable");
+                    log.trace("Response contained NO CACHE directive, cache was not suitable");
                     return false;
                 }
 
                 if (HeaderConstants.CACHE_CONTROL_NO_STORE.equals(elt.getName())) {
-                    log.debug("Response contained NO STORE directive, cache was not suitable");
+                    log.trace("Response contained NO STORE directive, cache was not suitable");
                     return false;
                 }
 
@@ -163,12 +163,12 @@ class CachedResponseSuitabilityChecker {
                     try {
                         int maxage = Integer.parseInt(elt.getValue());
                         if (validityStrategy.getCurrentAgeSecs(entry, now) > maxage) {
-                            log.debug("Response from cache was NOT suitable due to max age");
+                            log.trace("Response from cache was NOT suitable due to max age");
                             return false;
                         }
                     } catch (NumberFormatException ex) {
                         // err conservatively
-                        log.debug("Response from cache was malformed: " + ex.getMessage());
+                        log.debug("Response from cache was malformed" + ex.getMessage());
                         return false;
                     }
                 }
@@ -177,7 +177,7 @@ class CachedResponseSuitabilityChecker {
                     try {
                         int maxstale = Integer.parseInt(elt.getValue());
                         if (validityStrategy.getFreshnessLifetimeSecs(entry) > maxstale)
{
-                            log.debug("Response from cache was not suitable due to Max stale
freshness");
+                            log.trace("Response from cache was not suitable due to Max stale
freshness");
                             return false;
                         }
                     } catch (NumberFormatException ex) {
@@ -194,7 +194,7 @@ class CachedResponseSuitabilityChecker {
                         long age = validityStrategy.getCurrentAgeSecs(entry, now);
                         long freshness = validityStrategy.getFreshnessLifetimeSecs(entry);
                         if (freshness - age < minfresh) {
-                            log.debug("Response from cache was not suitable due to min fresh
" +
+                            log.trace("Response from cache was not suitable due to min fresh
" +
                                     "freshness requirement");
                             return false;
                         }
@@ -207,7 +207,7 @@ class CachedResponseSuitabilityChecker {
             }
         }
 
-        log.debug("Response from cache was suitable");
+        log.trace("Response from cache was suitable");
         return true;
     }
 

Modified: httpcomponents/httpclient/branches/4.1.x/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingHttpClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.1.x/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingHttpClient.java?rev=1087363&r1=1087362&r2=1087363&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.1.x/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingHttpClient.java
(original)
+++ httpcomponents/httpclient/branches/4.1.x/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingHttpClient.java
Thu Mar 31 16:22:52 2011
@@ -421,7 +421,7 @@ public class CachingHttpClient implement
     private HttpResponse revalidateCacheEntry(HttpHost target,
             HttpRequest request, HttpContext context, HttpCacheEntry entry,
             Date now) throws ClientProtocolException {
-        log.debug("Revalidating the cache entry");
+        log.trace("Revalidating the cache entry");
 
         try {
             if (asynchRevalidator != null
@@ -494,17 +494,17 @@ public class CachingHttpClient implement
 
     private void recordCacheMiss(HttpHost target, HttpRequest request) {
         cacheMisses.getAndIncrement();
-        if (log.isDebugEnabled()) {
+        if (log.isTraceEnabled()) {
             RequestLine rl = request.getRequestLine();
-            log.debug("Cache miss [host: " + target + "; uri: " + rl.getUri() + "]");
+            log.trace("Cache miss [host: " + target + "; uri: " + rl.getUri() + "]");
         }
     }
 
     private void recordCacheHit(HttpHost target, HttpRequest request) {
         cacheHits.getAndIncrement();
-        if (log.isDebugEnabled()) {
+        if (log.isTraceEnabled()) {
             RequestLine rl = request.getRequestLine();
-            log.debug("Cache hit [host: " + target + "; uri: " + rl.getUri() + "]");
+            log.trace("Cache hit [host: " + target + "; uri: " + rl.getUri() + "]");
         }
     }
     
@@ -664,7 +664,7 @@ public class CachingHttpClient implement
 
         Date requestDate = getCurrentDate();
 
-        log.debug("Calling the backend");
+        log.trace("Calling the backend");
         HttpResponse backendResponse = backend.execute(target, request, context);
         backendResponse.addHeader("Via", generateViaHeader(backendResponse));
         return handleBackendResponse(target, request, requestDate, getCurrentDate(),
@@ -842,7 +842,7 @@ public class CachingHttpClient implement
             Date responseDate,
             HttpResponse backendResponse) throws IOException {
 
-        log.debug("Handling Backend response");
+        log.trace("Handling Backend response");
         responseCompliance.ensureProtocolCompliance(request, backendResponse);
 
         boolean cacheable = responseCachingPolicy.isResponseCacheable(request, backendResponse);

Propchange: httpcomponents/httpclient/branches/4.1.x/httpclient-contrib/src/main/java/org/apache/http/contrib/auth/BouncySpnegoTokenGenerator.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 31 16:22:52 2011
@@ -1 +1,2 @@
 /httpcomponents/httpclient/branches/branch_4_1/contrib/org/apache/http/contrib/auth/BouncySpnegoTokenGenerator.java:755593-811107
+/httpcomponents/httpclient/trunk/httpclient-contrib/src/main/java/org/apache/http/contrib/auth/BouncySpnegoTokenGenerator.java:1087358

Propchange: httpcomponents/httpclient/branches/4.1.x/httpclient/src/test/resources/test.keystore
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 31 16:22:52 2011
@@ -1 +1,2 @@
+/httpcomponents/httpclient/trunk/httpclient/src/test/resources/test.keystore:1087358
 /httpcomponents/httpcore/branches/ibm_compat_branch/httpcore-nio/src/test/resources/test.keystore:755687-758898

Propchange: httpcomponents/httpclient/branches/4.1.x/src/docbkx/resources/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 31 16:22:52 2011
@@ -1 +1,2 @@
+/httpcomponents/httpclient/trunk/src/docbkx/resources:1087358
 /httpcomponents/httpcore/branches/ibm_compat_branch/src/docbkx/resources:755687-758898



Mime
View raw message