Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Logging for debugging
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Chris Johnson  
View profile  
 More options Jul 31 2012, 6:42 pm
From: Chris Johnson <wchrisjohn...@gmail.com>
Date: Tue, 31 Jul 2012 15:42:23 -0700 (PDT)
Local: Tues, Jul 31 2012 6:42 pm
Subject: Logging for debugging

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Anurag Priyam  
View profile  
 More options Aug 1 2012, 9:59 am
From: Anurag Priyam <anurag08pri...@gmail.com>
Date: Wed, 1 Aug 2012 19:29:48 +0530
Local: Wed, Aug 1 2012 9:59 am
Subject: Re: Logging for debugging

On Wed, Aug 1, 2012 at 4:12 AM, Chris Johnson <wchrisjohn...@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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions Older topic »