Fix for PDO errors on generic logging function