better logging for db