diff --git a/misc/log-analytics/import_logs.py b/misc/log-analytics/import_logs.py
index 9180e7f56565bb85477c4248debb19b6371474f1..5c1ed51c2ad9e7d487ffb326dd3ab6c30f965d5b 100755
--- a/misc/log-analytics/import_logs.py
+++ b/misc/log-analytics/import_logs.py
@@ -809,7 +809,7 @@ class Piwik(object):
             return json.loads(res)
         except ValueError:
             truncate_after = 300
-            raise urllib2.URLError('Piwik returned an invalid response: ' + res)
+            raise urllib2.URLError('Piwik returned an invalid response: ' + res[:truncate_after])
 
 
     @staticmethod