some work on logging to a database