Logging exercise solution