Move logging into a separate file.