Implemented logging functionality