add sync to stdout to see log entries immediately when redirected to log file..