Adding logging and monitoring