added database logging features

added database logging features