Added support for logging to a dedicated logfile.