ensure don't open log file before trancate file.

will failed to trancate file while file has opened on some filesystem(on the win32),   ensure don't open log file before trancate file.