work in progress: adding logging to DB