[master] Support for rolling logs

This replaces #3009 that was messed up. 

Adds support for rolling logs. When the log is rolled over diagnostics information is added to the top of the new log.

That's why we have a constructor where you can specify which logging to use. I'd be in favour of removing the above constructor completely, so that it's specified every time StoreMigrator is used.