The second implode() parameter needs to be an array. If you want to log the entire $logging array, probably you just want to pass it $logging (without the [$id]).
Without the ['id'] leads to the whole row being logged. Is there any way to just make it log the ID?