added flag for enabling debug logs and specifying log file target