Logging fix for alia/hayt/db.

This should catch our biggest cause of 500's atm.