Logs debug messages to file as well as the console.