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.
All database settings separate words with underscores, not dots. I think we should keep to that scheme until we decide to revisit our configuration.