Net/http: no way to get response status code for `ServeContent` and `ServeFile`

I have a custom http handler. When client request for a static assets, server side will call ServeContent() or ServeFile() from net/http package.
I also want to log the response status code generated from that two functions, just behave like nginx.
But it seems there is no way to get the result status code from server side. Any suggestion?

Implement ResponseWriter to do the logging and forward to your original ResponseWriter

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.