handle logging to file and enable console debug mode