postrank-labs / goliath

Goliath is a non-blocking Ruby web server framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What's the recommended approach to log in Goliath

larryzhao opened this issue · comments

I am new to Eventmachine/Goliath. I am now working on a API project using Grape + Goliath.

Everything else is fine except I am not sure how to do with the logging part.

I saw there's a rack.logger inside env and also saw the custom_logs example and the lantency example in Goliath wiki.

I am not sure what to do.

Is there a recommendation way for logging in Goliath, which will not block normal requests? I am using activesupport in my project so logger from activesupport is available if necessory.

Thank you very much!

Take a look at the checked in examples.. the default logger object should do the trick:
https://github.com/postrank-labs/goliath/blob/master/examples/async_upload.rb#L12

env.logger.{info,error,debug}.