Completed the logging functionality