move log into ServeHTTP