Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 76693 invoked from network); 28 Aug 2009 02:46:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 Aug 2009 02:46:35 -0000 Received: (qmail 88110 invoked by uid 500); 28 Aug 2009 02:46:34 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 88035 invoked by uid 500); 28 Aug 2009 02:46:34 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 88024 invoked by uid 99); 28 Aug 2009 02:46:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Aug 2009 02:46:34 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.9] (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 28 Aug 2009 02:46:31 +0000 Received: (qmail 76502 invoked by uid 99); 28 Aug 2009 02:46:09 -0000 Received: from localhost.apache.org (HELO [10.0.1.2]) (127.0.0.1) (smtp-auth username kocolosk, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Aug 2009 02:46:09 +0000 Message-Id: <6A6C5FF9-6972-4518-B9BF-5BB2AFDC22BD@apache.org> From: Adam Kocoloski To: dev@couchdb.apache.org In-Reply-To: <20090827233008.8127123888EC@eris.apache.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: svn commit: r808679 - /couchdb/trunk/src/couchdb/couch_httpd.erl Date: Thu, 27 Aug 2009 22:46:08 -0400 References: <20090827233008.8127123888EC@eris.apache.org> X-Mailer: Apple Mail (2.936) X-Virus-Checked: Checked by ClamAV on apache.org Hi Damien, I'm -1 on writing the response code as a separate line in the log file. I think it'll make parsing logfiles _really_ difficult, as the request and response code lines aren't necessarily going to show up one after the other. You'd have to match connection Pids, or something. Best, Adam On Aug 27, 2009, at 7:30 PM, damien@apache.org wrote: > Author: damien > Date: Thu Aug 27 23:30:08 2009 > New Revision: 808679 > > URL: http://svn.apache.org/viewvc?rev=808679&view=rev > Log: > Fixed spurious console errors caused when attempting to query > information about an already closed socket. > > Modified: > couchdb/trunk/src/couchdb/couch_httpd.erl > > Modified: couchdb/trunk/src/couchdb/couch_httpd.erl > URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd.erl?rev=808679&r1=808678&r2=808679&view=diff > = > = > = > = > = > = > = > = > ====================================================================== > --- couchdb/trunk/src/couchdb/couch_httpd.erl (original) > +++ couchdb/trunk/src/couchdb/couch_httpd.erl Thu Aug 27 23:30:08 2009 > @@ -135,9 +135,12 @@ > {FirstPart, _, _} -> > list_to_binary(FirstPart) > end, > - ?LOG_DEBUG("~p ~s ~p~nHeaders: ~p", [ > + ?LOG_INFO("~s - ~p ~s", [ > + MochiReq:get(peer), > MochiReq:get(method), > - RawUri, > + RawUri > + ]), > + ?LOG_DEBUG("HTTP ~p~nHeaders: ~p", [ > MochiReq:get(version), > mochiweb_headers:to_list(MochiReq:get(headers)) > ]), > @@ -151,7 +154,6 @@ > % possible (if any module references the atom, then it's > existing). > Meth -> couch_util:to_existing_atom(Meth) > end, > - > increment_method_stats(Method1), > % alias HEAD to GET as mochiweb takes care of stripping the body > Method = case Method1 of > @@ -173,7 +175,7 @@ > {ok, Resp} = > try > case authenticate_request(HttpReq, AuthenticationFuns) of > - Req when is_record(Req, httpd) -> > + #httpd{} = Req -> > HandlerFun(Req); > Response -> > Response > @@ -181,6 +183,8 @@ > catch > throw:{http_head_abort, Resp0} -> > {ok, Resp0}; > + exit:normal -> > + exit(normal); > throw:Error -> > ?LOG_DEBUG("Minor error in HTTP request: ~p",[Error]), > ?LOG_DEBUG("Stacktrace: ~p",[erlang:get_stacktrace()]), > @@ -198,13 +202,7 @@ > ?LOG_INFO("Stacktrace: ~p",[erlang:get_stacktrace()]), > send_error(HttpReq, Error) > end, > - > - ?LOG_INFO("~s - - ~p ~s ~B", [ > - MochiReq:get(peer), > - MochiReq:get(method), > - RawUri, > - Resp:get(code) > - ]), > + ?LOG_INFO("Response code: ~B", [Resp:get(code)]), > RequestTime = round(timer:now_diff(now(), Begin)/1000), > couch_stats_collector:record({couchdb, request_time}, > RequestTime), > couch_stats_collector:increment({httpd, requests}), > >