* Logging for debugging
@ 2012-07-31 22:42 Chris Johnson
2012-08-01 13:59 ` Anurag Priyam
0 siblings, 1 reply; 2+ messages in thread
From: Chris Johnson @ 2012-07-31 22:42 UTC (permalink / raw)
To: rack-devel
[-- Attachment #1: Type: text/plain, Size: 659 bytes --]
Hi,
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.
I'll also say that I'm mounting the Rack app inside a Rails app, and so I
need to be able to log to a file so I can tell how it's behaving within
Rails. I don't necessarily need to have the two apps (Rails and Rack)
logging to the same file.
Any help would be greatly appreciated.
Chris
[-- Attachment #2: Type: text/html, Size: 752 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Logging for debugging
2012-07-31 22:42 Logging for debugging Chris Johnson
@ 2012-08-01 13:59 ` Anurag Priyam
0 siblings, 0 replies; 2+ messages in thread
From: Anurag Priyam @ 2012-08-01 13:59 UTC (permalink / raw)
To: rack-devel
On Wed, Aug 1, 2012 at 4:12 AM, Chris Johnson <wchrisjohnson@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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-08-01 14:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-31 22:42 Logging for debugging Chris Johnson
2012-08-01 13:59 ` Anurag Priyam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).