adding database transaction middleware and setting up a sane logging config