From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS14383 205.234.109.0/24 X-Spam-Status: No, score=-0.6 required=5.0 tests=FREEMAIL_FROM, MSGID_FROM_MTA_HEADER,RP_MATCHES_RCVD,T_DKIM_INVALID shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Lee Bankewitz Newsgroups: gmane.comp.lang.ruby.unicorn.general Subject: Re: Log line formatting Date: Fri, 6 Nov 2009 17:09:30 -0500 Message-ID: References: <20091106214005.GA17969@dcvr.yhbt.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1257545408 29935 80.91.229.12 (6 Nov 2009 22:10:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Nov 2009 22:10:08 +0000 (UTC) To: unicorn list Original-X-From: mongrel-unicorn-bounces@rubyforge.org Fri Nov 06 23:10:01 2009 Return-path: Envelope-to: gclrug-mongrel-unicorn@m.gmane.org X-Original-To: mongrel-unicorn@rubyforge.org Delivered-To: mongrel-unicorn@rubyforge.org 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 :content-transfer-encoding; bh=YNkY3oXhVtPWFbK+I6gIrMS3iuQVNJJB2krWxDiIb5Y=; b=WirJefpLMgVHEBvMraE3+FBrGR9DWED9rX+DoEeGN6N7RQ12GhW/nI26qs1VYi4HV6 ZQ6j7zoRZiQKB1qlPZ8eIGgMayr/7+mb6BdTp3ExmziHI3578zd3rTH4hFpeTdq8Aek5 Iqmi0JIcKMpwH5b70WUr2UmO+bi+RYvgb+k0g= 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:content-transfer-encoding; b=DPLSyLuBSGaExeheUpaVIcNPaORRYPesDq9cvz/zxPLMHNSh1xbEhmgoh7ZlsH3Qlh X+x9f8/7xrDjgW2pUdVJHUBqwhyV6pmT3ATCRCEAsB8kffgn1mXelzNgEFLSD1mb1U/Z mOJin2DTIH7dEbX3p3t7AnrXyYMrlDfCp1GHw= In-Reply-To: <20091106214005.GA17969@dcvr.yhbt.net> X-BeenThere: mongrel-unicorn@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: mongrel-unicorn-bounces@rubyforge.org Errors-To: mongrel-unicorn-bounces@rubyforge.org Xref: news.gmane.org gmane.comp.lang.ruby.unicorn.general:144 Archived-At: Received: from rubyforge.org ([205.234.109.19]) by lo.gmane.org with esmtp (Exim 4.50) id 1N6X0L-0005wz-36 for gclrug-mongrel-unicorn@m.gmane.org; Fri, 06 Nov 2009 23:10:01 +0100 Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id A458B1588065; Fri, 6 Nov 2009 17:10:00 -0500 (EST) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by rubyforge.org (Postfix) with ESMTP id 3A55F18582C5 for ; Fri, 6 Nov 2009 17:09:30 -0500 (EST) Received: by ey-out-2122.google.com with SMTP id 9so341217eyd.29 for ; Fri, 06 Nov 2009 14:09:30 -0800 (PST) Received: by 10.213.24.28 with SMTP id t28mr5614087ebb.92.1257545370123; Fri, 06 Nov 2009 14:09:30 -0800 (PST) On Fri, Nov 6, 2009 at 4:40 PM, Eric Wong wrote: > Lee Bankewitz wrote: >> Howdy. >> >> I'm running Unicorn 0.94 in production (its working wonderfully). =A0One >> question about the log line formats in the unicorn log. >> >> In my unicorn config file, I have: >> logger Logger.new("log/unicorn.log") >> >> I see timestamps on the the initial log lines when unicorn first starts,= i.e.: >> "I, [2009-11-06T12:25:13.812367 #2437] =A0INFO -- : listening on >> addr=3D0.0.0.0:3000 fd=3D5" >> >> But the format of the log line changes soon thereafter: >> "master process ready" >> "worker=3D0 ready" >> >> any ideas why this is happening? I'd prefer to have the initial format >> for every line. > > Hi Lee, > > This with Rails? =A0Unfortunately, Rails seems to monkey patch the core > Logger format methods. =A0If you find a clean solution to this without > bad side effects, please let the rest of us know, thanks. > > -- > Eric Wong > _______________________________________________ > mongrel-unicorn mailing list > mongrel-unicorn@rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-unicorn > Thanks Eric, Rails does indeed override the default formatting of Logger. I got around it for now by setting the formatter explicitly to the ruby default formatter, as follows: # config/unicorn.rb unicorn_logger =3D Logger.new("unicorn.log") unicorn_logger.formatter =3D Logger::Formatter.new logger unicorn_logger I think its bad behavior by rails though, so I'll see if there's any interest in a Rails patch to address this. -lee