svn commit: r1136068 - in /ofbiz/trunk/applications: marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java order/src/org/ofbiz/order/shoppingcart/CartEventListener.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1136068 - in /ofbiz/trunk/applications: marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java order/src/org/ofbiz/order/shoppingcart/CartEventListener.java

jleroux@apache.org
Author: jleroux
Date: Wed Jun 15 14:28:00 2011
New Revision: 1136068

URL: http://svn.apache.org/viewvc?rev=1136068&view=rev
Log:
If ever you changed the stats.persist.visit property to false in serverstats.properties, these debug messages were uselessly cluttering the logs

Modified:
    ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java
    ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CartEventListener.java

Modified: ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java?rev=1136068&r1=1136067&r2=1136068&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java (original)
+++ ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java Wed Jun 15 14:28:00 2011
@@ -187,7 +187,7 @@ public class TrackingCodeEvents {
 
         //persist that info by associating with the current visit
         GenericValue visit = VisitHandler.getVisit(request.getSession());
-        if (visit == null) {
+        if (visit == null && !UtilProperties.propertyValueEqualsIgnoreCase("serverstats", "stats.persist.visit", "false")) {
             Debug.logWarning("Could not get visit, not associating trackingCode [" + trackingCodeId + "] with visit", module);
         } else {
             GenericValue trackingCodeVisit = delegator.makeValue("TrackingCodeVisit",
@@ -311,7 +311,7 @@ public class TrackingCodeEvents {
         Delegator delegator = (Delegator) request.getAttribute("delegator");
         java.sql.Timestamp nowStamp = UtilDateTime.nowTimestamp();
         GenericValue visit = VisitHandler.getVisit(request.getSession());
-        if (visit == null) {
+        if (visit == null && !UtilProperties.propertyValueEqualsIgnoreCase("serverstats", "stats.persist.visit", "false")) {
             Debug.logWarning("Could not get visit, not checking trackingCode cookies to associate with visit", module);
         } else {
             // loop through cookies and look for ones with a name that starts with TKCDT_ for trackable cookies

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CartEventListener.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CartEventListener.java?rev=1136068&r1=1136067&r2=1136068&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CartEventListener.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CartEventListener.java Wed Jun 15 14:28:00 2011
@@ -25,6 +25,7 @@ import javax.servlet.http.HttpSessionEve
 import javax.servlet.http.HttpSessionListener;
 
 import org.ofbiz.base.util.Debug;
+import org.ofbiz.base.util.UtilProperties;
 import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.entity.Delegator;
 import org.ofbiz.entity.DelegatorFactory;
@@ -71,6 +72,7 @@ public class CartEventListener implement
 
             GenericValue visit = VisitHandler.getVisit(session);
             if (visit == null) {
+            if (UtilProperties.propertyValueEqualsIgnoreCase("serverstats", "stats.persist.visit", "false")) return;
                 Debug.logError("Could not get the current visit, not saving abandoned cart info.", module);
                 return;
             }