Added Logging and restart capabilities