Logging request payload

38 views
Skip to first unread message

Alessandro Puccetti

unread,
May 10, 2020, 10:59:31 AM5/10/20
to Gorilla web toolkit
Hi, 

I am new in programming go and I am trying to do a little project using Gorilla. I want to use the Logger handler to log all the requests but I would like to log also the payload. Is this possible without writing your own logging code from scratch?

Thank you

Alessandro Puccetti

unread,
May 10, 2020, 11:02:35 AM5/10/20
to Gorilla web toolkit
I am trying to replicate the NGINX access logs logic.

Matt S

unread,
May 10, 2020, 11:06:52 AM5/10/20
to goril...@googlegroups.com
Logging the body of a request is pretty uncommon (and also often a privacy issue) - should take a look at the blog post I wrote up on writing your own logging middleware here: https://blog.questionable.services/article/guide-logging-middleware-go/

--
You received this message because you are subscribed to the Google Groups "Gorilla web toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gorilla-web...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gorilla-web/29e76e7b-d50d-4b51-a647-f285402b4336%40googlegroups.com.

Alessandro Puccetti

unread,
May 10, 2020, 11:09:18 AM5/10/20
to Gorilla web toolkit
Thank you, I will give a look.

On Sunday, 10 May 2020 16:06:52 UTC+1, Matt S wrote:
Logging the body of a request is pretty uncommon (and also often a privacy issue) - should take a look at the blog post I wrote up on writing your own logging middleware here: https://blog.questionable.services/article/guide-logging-middleware-go/

On Sun, May 10, 2020 at 7:59 AM Alessandro Puccetti <ale.p...@gmail.com> wrote:
Hi, 

I am new in programming go and I am trying to do a little project using Gorilla. I want to use the Logger handler to log all the requests but I would like to log also the payload. Is this possible without writing your own logging code from scratch?

Thank you

--
You received this message because you are subscribed to the Google Groups "Gorilla web toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to goril...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages