Add db logging