Output lag between output window and log.lammps file

Dear lammps users
How can I get exact output in the lammps log file as in the output window? For example, if output windows has the output till say 10000 steps, logfile will have upto 4000-5000 steps.

Is there any way so that when I stop the simulation in between, same output is also printed in log.lammps file?

Thanks
Rajesh

Hi Rajesh

Try using:

thermo_modify flush yes

http://lammps.sandia.gov/doc/thermo_modify.html

Cheers
Andrew