diff --git a/core/CacheFile.php b/core/CacheFile.php
index 7a1c824ff8977eb8a4de2be58b1c06a0b7a22d07..f63cdd6d781527d61fb63a3e2638a433490c9437 100644
--- a/core/CacheFile.php
+++ b/core/CacheFile.php
@@ -79,6 +79,12 @@ class CacheFile
             $this->opCacheInvalidate($cacheFilePath);
         }
 
+        if ('general' === $id && Common::isPhpCliMode()) {
+
+            $message = 'The path is ' . $cacheFilePath;
+            \Piwik\Log::getInstance()->customLogToFileForDebuggingIfYouStillSeeThisHereRemoveIt($message, false);
+        }
+
         $ok = @include($cacheFilePath);
 
         if ($ok && $cache_complete == true) {
@@ -197,6 +203,9 @@ class CacheFile
      */
     public function deleteAll()
     {
+        $message = 'Delete All Tracker Cache';
+        \Piwik\Log::getInstance()->customLogToFileForDebuggingIfYouStillSeeThisHereRemoveIt($message);
+
         $self = $this;
         $beforeUnlink = function ($path) use ($self) {
             $self->opCacheInvalidate($path);
diff --git a/core/Tracker.php b/core/Tracker.php
index 5c491cb95df047e9ab841d83fede610edeb5936b..69c1a9b7e089fe024372d18211e7d690fd58bb92 100644
--- a/core/Tracker.php
+++ b/core/Tracker.php
@@ -254,7 +254,7 @@ class Tracker
         }
 
         Piwik::postEvent('Tracker.end');
-        
+
         $this->end();
 
         $this->flushOutputBuffer();
diff --git a/core/Tracker/Cache.php b/core/Tracker/Cache.php
index 9183b191b79e174ed3c079304e4eaf1edffadde9..eea63d4e13fea41ff206460408716069038cd654 100644
--- a/core/Tracker/Cache.php
+++ b/core/Tracker/Cache.php
@@ -103,6 +103,9 @@ class Cache
      */
     static public function clearCacheGeneral()
     {
+        $message = 'Clear Cache General ';
+        \Piwik\Log::getInstance()->customLogToFileForDebuggingIfYouStillSeeThisHereRemoveIt($message);
+
         self::getInstance()->delete('general');
     }
 
@@ -118,9 +121,19 @@ class Cache
         $cacheId = 'general';
 
         if (($cacheContent = $cache->get($cacheId)) !== false) {
+
+            if (Common::isPhpCliMode()) {
+                $message = 'there is already a cache general';
+                \Piwik\Log::getInstance()->customLogToFileForDebuggingIfYouStillSeeThisHereRemoveIt($message, false);
+            }
             return $cacheContent;
         }
 
+        if (Common::isPhpCliMode()) {
+            $message = 'recreating the cache general';
+            \Piwik\Log::getInstance()->customLogToFileForDebuggingIfYouStillSeeThisHereRemoveIt($message, false);
+        }
+
         Tracker::initCorePiwikInTrackerMode();
         $cacheContent = array(
             'isBrowserTriggerEnabled' => Rules::isBrowserTriggerEnabled(),
diff --git a/tests/LocalTracker.php b/tests/LocalTracker.php
index 366996b46579e970d676ffe62877ec7fb49705ce..153035d70b9fdff43c5506fba321d1ec633ee936 100755
--- a/tests/LocalTracker.php
+++ b/tests/LocalTracker.php
@@ -43,6 +43,11 @@ class Piwik_LocalTracker extends PiwikTracker
             $requests = array($testEnvironmentArgs);
         }
 
+
+        $cacheContent = Cache::getCacheGeneral();
+        $message = 'CacheContent pre local ' . var_export($cacheContent, 1);
+        \Piwik\Log::getInstance()->customLogToFileForDebuggingIfYouStillSeeThisHereRemoveIt($message, false);
+
         // unset cached values
         Cache::$trackerCache = null;
         Tracker::setForceIp(null);
@@ -74,6 +79,10 @@ class Piwik_LocalTracker extends PiwikTracker
         $oldCookie = $_COOKIE;
 //        parse_str(parse_url($this->requestCookie, PHP_URL_QUERY), $_COOKIE);
 
+        $cacheContent = Cache::getCacheGeneral();
+        $message = 'CacheContent before local ' . var_export($cacheContent, 1);
+        \Piwik\Log::getInstance()->customLogToFileForDebuggingIfYouStillSeeThisHereRemoveIt($message, false);
+
         // do tracking and capture output
         ob_start();