Added option to log into a file and standard output