log database queries if debug level 3
merged