Move debug from connection to server. Closes #2072