mozilla-services / autograph

Mozilla's digital signature service
https://hub.docker.com/r/mozilla/autograph/
Mozilla Public License 2.0
151 stars 35 forks source link

Add response code to application log. #318

Open Micheletto opened 5 years ago

Micheletto commented 5 years ago

Here's an example of the fields from Stackdriver logging: method: "GET"
msg: "request"
proto: "HTTP/1.0"
remoteAddress: "XXX.XXX.XXX.XXX:XXX"
remoteAddressChain: "[XXX.XXX.XXX.XXX]"
rid: "XXXXXXXXXXXXX"
t: 0
ua: "ELB-HealthChecker/1.0"
url: "/lbheartbeat"

It would be convenient to have the status code.

g-k commented 5 years ago

Looked into this a bit (web search and stared at the net/http src), you'd think we could add code: w.<some attr or method of http.ResponseWriter> in autograph's logging.go but I don't see any publicly accessible fields. Seems like there should be a string to pass to w.Header() but the w.Header() map doesn't include a status. There are private status fields.

jvehent commented 4 years ago

Could we grab this information at the nginx layer instead?

g-k commented 4 years ago

I think bob did change it to use the nginx logs for the metrics, so we might be able to close this out.

On Thu, Mar 26, 2020 at 9:08 AM Julien Vehent notifications@github.com wrote:

Could we grab this information at the nginx layer instead?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mozilla-services/autograph/issues/318#issuecomment-604421035, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABXKLKL6MSGR62CETEQE4LRJNHVXANCNFSM4IKOQE2Q .