Fetch truncate logs

continuation of #9222 and #6662, closes #6630
I think instead we need to write to a temporary file, this is not going to be atomic by closing the file and re-opening it. Sorry I wanted this to be the hero we needed.