Add the option to include log writes as dbwrites

Log table writes are not counted as db writes,
I've added a setting, enabled by default, to count
them.