Log to file when running in debug mode.