From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.204.72.79 with SMTP id l15cs90623bkj; Thu, 18 Jun 2009 09:24:45 -0700 (PDT) Received-SPF: pass (google.com: domain of grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com designates 10.90.87.19 as permitted sender) client-ip=10.90.87.19; Authentication-Results: mr.google.com; spf=pass (google.com: domain of grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com designates 10.90.87.19 as permitted sender) smtp.mail=grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com; dkim=pass header.i=grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com Received: from mr.google.com ([10.90.87.19]) by 10.90.87.19 with SMTP id k19mr1210706agb.26.1245342284204 (num_hops = 1); Thu, 18 Jun 2009 09:24:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:received:received:x-sender:x-apparently-to :received:received:received-spf:authentication-results:received :dkim-signature:domainkey-signature:mime-version:received :in-reply-to:references:date:message-id:subject:from:to:content-type :reply-to:sender:precedence:x-google-loop:mailing-list:list-id :list-post:list-help:list-unsubscribe:x-beenthere-env:x-beenthere; bh=sD/qlVgh2UIvZz0E4hl7fk3VkEA/xR/D4a6Qmsm1T4M=; b=fOtKsw/xx6z5Z98C8iyLwa4/FNWQ8lH921MLEcfPFVthEGnvVgCQdp37qzy7EoMwWx FyyauUbsWj8zadgv6Xs/YQqImaknkT+j4gCN0U0FJHMkLvPQ17FG1Zi+9WOy8Wm4diru I6ZkEr7O0aa/4Vqs5bZ8JGXX9Mm8ME0xdp6lw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=x-sender:x-apparently-to:received-spf:authentication-results :dkim-signature:domainkey-signature:mime-version:in-reply-to :references:date:message-id:subject:from:to:content-type:reply-to :sender:precedence:x-google-loop:mailing-list:list-id:list-post :list-help:list-unsubscribe:x-beenthere-env:x-beenthere; b=hz92SKNDuk0U63h/iOFjlbEEZ7uJZ5X/A9TC/mM/WkUgf3Vz+IVHxigw/BV3xR/iLa AMLFv0YRTSEIT1WUynUZgx9brAtsJR2EEv97KFy+LK1DBuounMLBvVa6SQqVn3lqN7s7 8M25ZSqDBd7RSuEABC6B1C1QXCRZCy2lzsRBI= Received: by 10.90.87.19 with SMTP id k19mr161542agb.26.1245342283988; Thu, 18 Jun 2009 09:24:43 -0700 (PDT) Received: by 10.106.241.10 with SMTP id o10gr1462prh.0; Thu, 18 Jun 2009 09:24:35 -0700 (PDT) X-Sender: gmelton@gmail.com X-Apparently-To: rack-devel@googlegroups.com Received: by 10.229.96.20 with SMTP id f20mr579315qcn.3.1245342274789; Thu, 18 Jun 2009 09:24:34 -0700 (PDT) Return-Path: Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.24]) by gmr-mx.google.com with ESMTP id 25si206845qyk.4.2009.06.18.09.24.33; Thu, 18 Jun 2009 09:24:33 -0700 (PDT) Received-SPF: pass (google.com: domain of gmelton@gmail.com designates 74.125.92.24 as permitted sender) client-ip=74.125.92.24; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of gmelton@gmail.com designates 74.125.92.24 as permitted sender) smtp.mail=gmelton@gmail.com; dkim=pass (test mode) header.i=@gmail.com Received: by qw-out-2122.google.com with SMTP id 9so683387qwb.27 for ; Thu, 18 Jun 2009 09:24:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Tca3lPNmmJOSD8RCOY3hLcaTjMUA+jBNv5vK9NOQrDo=; b=ZwPvMKlcH4s70y/uOg9Me45I2eHkLTeFSReeOmLeAPN9R7ipWOAidtUYEq4RUkQQSS 5w3er6+uTPKxHQyWSNSY6c77Q6RiG9Pqp3ATewieT8t/2enSguPX8FY/RWND/v/cdmXZ ecEhlBJp2ITFMvJ4CATy/BIdVmdZZRrlIQ6Hs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=eQSUQ0bmxIYF6OQk2oazER4EG5LAgq+Azq9DOdeYtnxNyfmcEWXsOBYI5kdqTHqrJd 1vpqNN+CFmf7TCVWudzfin1E0OV/1CA7lIkTokFBQq0Ukh28ZoujjWmoIKwul9TwozAD 21Z82a6oD/MwhAxZ9MmVFX7UbDPx5yQ1mBLHU= MIME-Version: 1.0 Received: by 10.229.96.15 with SMTP id f15mr307326qcn.91.1245342273598; Thu, 18 Jun 2009 09:24:33 -0700 (PDT) In-Reply-To: <9c00d3e00906172254v2ef00a90m22e49e197b9742cb@mail.gmail.com> References: <5976e8970906172049q17f7b9aetd9bb00b64c89430d@mail.gmail.com> <9c00d3e00906172254v2ef00a90m22e49e197b9742cb@mail.gmail.com> Date: Thu, 18 Jun 2009 09:24:33 -0700 Message-ID: <5976e8970906180924u66ce2c45ra8b58be8721c2e7b@mail.gmail.com> Subject: Re: Common Logger Help From: Greg Melton To: rack-devel@googlegroups.com Content-Type: multipart/alternative; boundary=00163683222ad7770c046ca1d771 Reply-To: rack-devel@googlegroups.com Sender: rack-devel@googlegroups.com Precedence: bulk X-Google-Loop: groups Mailing-List: list rack-devel@googlegroups.com; contact rack-devel+owner@googlegroups.com List-Id: List-Post: List-Help: List-Unsubscribe: , X-BeenThere-Env: rack-devel@googlegroups.com X-BeenThere: rack-devel@googlegroups.com --00163683222ad7770c046ca1d771 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Thanks Michael! I noticed CommonLogger accepted a log param -- just wasn't sure where to grab it from. I'll look into this today and let you know. -greg On Wed, Jun 17, 2009 at 10:54 PM, Michael Fellinger wrote: > > On Thu, Jun 18, 2009 at 12:49 PM, Greg Melton 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 > --00163683222ad7770c046ca1d771 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thanks Michael! I noticed CommonLogger accepted a log param -- just wasn= 9;t sure where to grab it from. I'll look into this today and let you k= now.

-greg

On Wed, Jun 17, 2009 at= 10:54 PM, Michael Fellinger <m.fellinger@gmail.com> wrote:

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 =A0:)

> I can see one of the options when calling rackup is a placeholder for = an
> access log.
>
> options =3D {:Port =3D> 9292, :Host =3D> "0.0.0.0", :A= ccessLog =3D> []}
>
> From what I can tell this isn't used anywhere.
>
> I've tried this and it works up until you run a rackup app daemoni= zed:
>
> rackup config.ru &g= t; /full/path/file.log
>
> Once daemonized the following lines are called:
>
> =A0=A0=A0 STDIN.reopen "/dev/null"
> =A0=A0=A0 STDOUT.reopen "/dev/null", "a"
> =A0=A0=A0 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&= #39;ve had
> mixed results in different environments. I was hoping a solution exist= ed
> without having to touch the rack code base.
>
> Any help would be greatly appreciated.
>
> Thanks,
> Greg

--00163683222ad7770c046ca1d771--