Better logging during database activities