Immediately write history lines and limit file size to 400MB