couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject couch commit: updated refs/heads/master to 9ffeeaf
Date Mon, 15 Sep 2014 13:21:16 GMT
Repository: couchdb-couch
Updated Branches:
  refs/heads/master e4976341e -> 9ffeeaf02


Restore ability to suppress httpd log


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/9ffeeaf0
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/9ffeeaf0
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/9ffeeaf0

Branch: refs/heads/master
Commit: 9ffeeaf028cc4c5be381b0c2eb738aa738ce07c4
Parents: e497634
Author: Robert Newson <rnewson@apache.org>
Authored: Mon Sep 15 14:19:15 2014 +0100
Committer: Robert Newson <rnewson@apache.org>
Committed: Mon Sep 15 14:19:15 2014 +0100

----------------------------------------------------------------------
 src/couch_httpd.erl | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/9ffeeaf0/src/couch_httpd.erl
----------------------------------------------------------------------
diff --git a/src/couch_httpd.erl b/src/couch_httpd.erl
index 2fefd2f..bebc3b8 100644
--- a/src/couch_httpd.erl
+++ b/src/couch_httpd.erl
@@ -604,13 +604,18 @@ verify_is_server_admin(#user_ctx{roles=Roles}) ->
     end.
 
 log_request(#httpd{mochi_req=MochiReq,peer=Peer}=Req, Code) ->
-    couch_log:notice("~s - - ~s ~s ~B", [
-        Peer,
-        MochiReq:get(method),
-        MochiReq:get(raw_path),
-        Code
-    ]),
-    gen_event:notify(couch_plugin, {log_request, Req, Code}).
+    case erlang:get(dont_log_request) of
+        true ->
+            ok;
+        _ ->
+            couch_log:notice("~s - - ~s ~s ~B", [
+                Peer,
+                MochiReq:get(method),
+                MochiReq:get(raw_path),
+                Code
+            ]),
+            gen_event:notify(couch_plugin, {log_request, Req, Code})
+    end.
 
 start_response_length(#httpd{mochi_req=MochiReq}=Req, Code, Headers, Length) ->
     log_request(Req, Code),


Mime
View raw message