rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / code / Atom feed
From: Anurag Priyam <anurag08priyam@gmail.com>
To: rack-devel@googlegroups.com
Subject: Re: Logging for debugging
Date: Wed, 1 Aug 2012 19:29:48 +0530	[thread overview]
Message-ID: <CAD1m08V+7thT9TbcAsdk9kmscM4dSTtjpJNMekYo3vHPjJPEkA@mail.gmail.com> (raw)
In-Reply-To: <5b9ef89c-7467-433c-9fa1-9044edeb4013@googlegroups.com>

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

      reply	other threads:[~2012-08-01 14:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-31 22:42 Chris Johnson
2012-08-01 13:59 ` Anurag Priyam [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://groups.google.com/group/rack-devel

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAD1m08V+7thT9TbcAsdk9kmscM4dSTtjpJNMekYo3vHPjJPEkA@mail.gmail.com \
    --to=rack-devel@googlegroups.com \
    --subject='Re: Logging for debugging' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/rack.git

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).