call debug log only when needed, not on all server requests