Don't lose messages when opening a file for logging.