samber / slog-chi

🚨 Chi middleware for slog logger
https://pkg.go.dev/github.com/samber/slog-chi
MIT License
44 stars 6 forks source link

Add more attributes & group attributes into request/response #6

Closed topi314 closed 8 months ago

topi314 commented 10 months ago

I'm aware of the breaking nature of this pr. I think it makes more sense to group attributes into request & response. I went ahead & added some missing information such as request/response body size & remote address.

The context key is also recommended to be a custom type to avoid clashes as best as possible.

Also having the http status code in the log message is convenient since people prob remember that one more.

If you have any thoughts on this let me know

topi314 commented 9 months ago

any chance you can take a look at this again?

samber commented 8 months ago

Oops, I made a mistake with git, while editing your PR.

I just merged to master anyway.

Thanks for the contrib!

(BTW, I need to update the README now)

topi314 commented 8 months ago

thanks for getting back to this, awesome :)