Logging functionality added again