traefik / whoami

Tiny Go server that prints os information and HTTP request to output
https://traefik.io
Apache License 2.0
1.04k stars 222 forks source link

add access logs #50

Closed pyaillet closed 2 years ago

pyaillet commented 2 years ago

Hi ! Thank you for making and maintaining whoami.

Would you be interested in access logs? I saw another PR proposing the same but relying on external dependencies, so this one comes without adding any dependencies.

It does not currently get the status code of the request. If needed I was thinking of implementing a custom ResponseWriter decorator function to grab it from the wrapped handler, or maybe you have another better idea?

Closes #42

ldez commented 2 years ago

Hi, can you explain your context and why, for you, this is an interesting/useful feature for this project?

pyaillet commented 2 years ago

We use the whoami docker image for training and demos, mainly with k8s. It would help mimic the behaviour of a regular (yet more complex) web application, and make the link between the container instance receiving the request and the logs produced.