function printLog(str)
   if logging=="yes" then
-    capture("logger -t beaconmon "..str)
+    capture("logger -t beaconmon \""..str.."\"")
   else 
     print(str)  
   end 
 
 function mqtt_pub(path,value)
   res=mqtt_client:publish(path,value)
-  printLog("Pub "..path.." "..value.." returned "..res);
+  printLog("Pub "..path.." returned "..res);
   return res
 end