Logging every request to grape

1,202 views
Skip to first unread message

David MZ

unread,
Dec 30, 2013, 5:46:52 PM12/30/13
to ruby-...@googlegroups.com
I would like to have a logger, logging any request done to my API, I saw many tutorials on how to add a logger helper, I am looking for something that does logging automatically, with the route and parameters and maybe some other metadata. What is the best approach to take?

Thanks

David MZ

unread,
Dec 30, 2013, 5:51:12 PM12/30/13
to ruby-...@googlegroups.com
I am mounted on rack, using config.ru and thin

Daniel Doubrovkine

unread,
Dec 31, 2013, 9:35:01 AM12/31/13
to ruby-...@googlegroups.com

Implement it as a Grape middleware, something like https://gist.github.com/dblock/4247912

--
You received this message because you are subscribed to the Google Groups "Grape Framework Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-grape+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

David MZ

unread,
Dec 31, 2013, 9:38:01 AM12/31/13
to ruby-...@googlegroups.com
Thanks! i'll see if I can make it work


--
You received this message because you are subscribed to a topic in the Google Groups "Grape Framework Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ruby-grape/KnKq2iIGamU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ruby-grape+...@googlegroups.com.

adr...@softmad.pl

unread,
Apr 19, 2015, 9:56:01 PM4/19/15
to ruby-...@googlegroups.com
Just created a gem that gives you exactly what you want. Check it out https://rubygems.org/gems/grape_logging
Reply all
Reply to author
Forward
0 new messages