postrank-labs/goliath

What's the recommended approach to log in Goliath

larryzhao opened this issue · 1 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}.