Added option to log into a file