Fix database log codes