From: Michael Fellinger <m.fellinger@gmail.com>
To: rack-devel@googlegroups.com
Subject: Re: Common Logger Help
Date: Thu, 18 Jun 2009 14:54:39 +0900 [thread overview]
Message-ID: <9c00d3e00906172254v2ef00a90m22e49e197b9742cb@mail.gmail.com> (raw)
In-Reply-To: <5976e8970906172049q17f7b9aetd9bb00b64c89430d@mail.gmail.com>
On Thu, Jun 18, 2009 at 12:49 PM, Greg Melton<gmelton@gmail.com> wrote:
> Is there anyway to configure the common logger to output to a file?
require 'logger'
use Rack::CommonLogger, Logger.new('/some/file/somewhere.log')
Hope that helps, didn't actually check it, but that's the general
direction you should go :)
> I can see one of the options when calling rackup is a placeholder for an
> access log.
>
> options = {:Port => 9292, :Host => "0.0.0.0", :AccessLog => []}
>
> From what I can tell this isn't used anywhere.
>
> I've tried this and it works up until you run a rackup app daemonized:
>
> rackup config.ru > /full/path/file.log
>
> Once daemonized the following lines are called:
>
> STDIN.reopen "/dev/null"
> STDOUT.reopen "/dev/null", "a"
> STDERR.reopen "/dev/null", "a"
>
> I'm assuming this kills the outputing so it never reaches the log file. I
> know the path is change to root during the daemonization.
>
> I've experimented with commenting out the STDOUT line above and I've had
> mixed results in different environments. I was hoping a solution existed
> without having to touch the rack code base.
>
> Any help would be greatly appreciated.
>
> Thanks,
> Greg
next prev parent reply other threads:[~2009-06-18 5:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-18 3:49 Common Logger Help Greg Melton
2009-06-18 5:54 ` Michael Fellinger [this message]
2009-06-18 16:24 ` Greg Melton
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=9c00d3e00906172254v2ef00a90m22e49e197b9742cb@mail.gmail.com \
--to=rack-devel@googlegroups.com \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).