couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [3/4] git commit: updated refs/heads/1867-feature-plugins to 742df6a
Date Wed, 02 Oct 2013 17:27:19 GMT
Fire a log_request event when requests are logged


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

Branch: refs/heads/1867-feature-plugins
Commit: b837e34813a6b8b2c379a4082ea58e1e4f306b8c
Parents: 23d0199
Author: Jason Smith (work) <jason.h.smith@gmail.com>
Authored: Mon Aug 19 13:16:40 2013 +0000
Committer: Jason Smith (work) <jason.h.smith@gmail.com>
Committed: Mon Aug 19 17:34:49 2013 +0000

----------------------------------------------------------------------
 src/couchdb/couch_httpd.erl | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/b837e348/src/couchdb/couch_httpd.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl
index 7c89d0e..28932ba 100644
--- a/src/couchdb/couch_httpd.erl
+++ b/src/couchdb/couch_httpd.erl
@@ -611,13 +611,14 @@ verify_is_server_admin(#user_ctx{roles=Roles}) ->
     false -> throw({unauthorized, <<"You are not a server admin.">>})
     end.
 
-log_request(#httpd{mochi_req=MochiReq,peer=Peer}, Code) ->
+log_request(#httpd{mochi_req=MochiReq,peer=Peer}=Req, Code) ->
     ?LOG_INFO("~s - - ~s ~s ~B", [
         Peer,
         MochiReq:get(method),
         MochiReq:get(raw_path),
         Code
-    ]).
+    ]),
+    gen_event:notify(couch_plugin, {log_request, Req, Code}).
 
 
 start_response_length(#httpd{mochi_req=MochiReq}=Req, Code, Headers, Length) ->


Mime
View raw message