added option to forward console messages to log file.