Support for rolling logs

Adds support for rolling logs. When the log is rolled over diagnostics information is added to the top of the new log.
Not sure if there is a logical way to migrate that setting. The deafult for the new one should be ok in the vast majority of cases.