Optionally log incoming mqtt messages to the mqtt_history table