Added error logging to files, start app with "log" command line parameter;