Updated so that messages go to the console as well as the log file.