ADD Flag to switch the log flushing on and off

Flag for switching the log flushing on and off.