couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [27/50] git commit: updated refs/heads/1894-feature-experimental-nodejs-couchjs to 532100c
Date Thu, 03 Oct 2013 15:47:25 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/f8509fad
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/f8509fad
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/f8509fad

Branch: refs/heads/1894-feature-experimental-nodejs-couchjs
Commit: f8509fad094c0a0bf2fb1692b2702dfd7fef4cdb
Parents: 9504301
Author: Jason Smith (work) <jason.h.smith@gmail.com>
Authored: Mon Aug 19 13:16:40 2013 +0000
Committer: Jan Lehnardt <jan@apache.org>
Committed: Thu Oct 3 16:08:37 2013 +0200

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


http://git-wip-us.apache.org/repos/asf/couchdb/blob/f8509fad/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