Added statistics logging facility.