Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3179BD39E for ; Sat, 17 Nov 2012 19:52:55 +0000 (UTC) Received: (qmail 17598 invoked by uid 500); 17 Nov 2012 19:52:51 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 17299 invoked by uid 500); 17 Nov 2012 19:52:51 -0000 Mailing-List: contact commits-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 commits@couchdb.apache.org Received: (qmail 16401 invoked by uid 99); 17 Nov 2012 19:52:50 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 17 Nov 2012 19:52:50 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 235DD314266; Sat, 17 Nov 2012 19:52:50 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: nslater@apache.org To: commits@couchdb.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [21/30] git commit: log 5xx responses at error level Message-Id: <20121117195250.235DD314266@tyr.zones.apache.org> Date: Sat, 17 Nov 2012 19:52:50 +0000 (UTC) log 5xx responses at error level This change should reduce the risk that administrators fail to recognize correctable server errors without creating excess noise. If malformed requests start throwing 5xx errors into the logs, we should look at detecting them and reporting a better error, probably a 4xx, but it's more important that an admin known that, e.g., the permissions of a .couch file are wrong. Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/e896b0b7 Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/e896b0b7 Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/e896b0b7 Branch: refs/heads/docs Commit: e896b0b70cc21d3a13b886ecd55732db3f247ac2 Parents: 4b6475d Author: Randall Leeds Authored: Thu Oct 25 09:38:18 2012 -0700 Committer: Randall Leeds Committed: Thu Oct 25 09:41:46 2012 -0700 ---------------------------------------------------------------------- src/couchdb/couch_httpd.erl | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/e896b0b7/src/couchdb/couch_httpd.erl ---------------------------------------------------------------------- diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl index 1fdfb0c..45ceebc 100644 --- a/src/couchdb/couch_httpd.erl +++ b/src/couchdb/couch_httpd.erl @@ -669,7 +669,9 @@ send_response(#httpd{mochi_req=MochiReq}=Req, Code, Headers, Body) -> log_request(Req, Code), couch_stats_collector:increment({httpd_status_codes, Code}), Headers2 = http_1_0_keep_alive(MochiReq, Headers), - if Code >= 400 -> + if Code >= 500 -> + ?LOG_ERROR("httpd ~p error response:~n ~s", [Code, Body]); + Code >= 400 -> ?LOG_DEBUG("httpd ~p error response:~n ~s", [Code, Body]); true -> ok end,