Added logging and basic MQTT integration