On Wed, Aug 1, 2012 at 4:12 AM, Chris Johnson <
wchris...@gmail.com> wrote:
> I'm simply trying to configure a *very* simple Rack app to enable logging to
> a file so I can tell what's going on when I exercise the app. I am using
> Grape (gem) within a basic Rack app to build an API, and I can't tell what
> is going on. I've spent over an hour, and yet cannot find ANYTHING on how to
> configure a logger inside Rack to log text to a file.
What is this Rack app logging? If the app is using a compliant
middleware to log, for example, HTTP requests, setting
'rack.errors'[1] to a File object should work.
If you are looking to log your own actions in the app, `Logger` class
from Ruby's standard library is probably what you need. You can use
`Rack::CommonLogger` (`enable :logger` in Sinatra) to log HTTP
requests in common log format.
[1]:
http://rack.rubyforge.org/doc/SPEC.html
--
Anurag Priyam