You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by jh...@apache.org on 2013/09/08 17:37:11 UTC

[1/2] git commit: updated refs/heads/1867-feature-plugins-jhs to b837e34

Updated Branches:
  refs/heads/1867-feature-plugins-jhs ae61fbb07 -> b837e3481


A handler for 'couch_plugin' events'


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

Branch: refs/heads/1867-feature-plugins-jhs
Commit: 23d019988afdda5719d72d650792832fc4a972a5
Parents: ae61fbb
Author: Jason Smith (work) <ja...@gmail.com>
Authored: Mon Aug 19 13:07:23 2013 +0000
Committer: Jason Smith (work) <ja...@gmail.com>
Committed: Mon Aug 19 13:07:23 2013 +0000

----------------------------------------------------------------------
 src/couchdb/couch_secondary_sup.erl | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/23d01998/src/couchdb/couch_secondary_sup.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_secondary_sup.erl b/src/couchdb/couch_secondary_sup.erl
index 6320fd9..6dd5604 100644
--- a/src/couchdb/couch_secondary_sup.erl
+++ b/src/couchdb/couch_secondary_sup.erl
@@ -24,7 +24,14 @@ init([]) ->
             permanent,
             infinity,
             supervisor,
-            [couch_db_update_notifier_sup]}
+            [couch_db_update_notifier_sup]},
+
+        {couch_plugin_event,
+            {gen_event, start_link, [{local, couch_plugin}]},
+            permanent,
+            brutal_kill,
+            worker,
+            dynamic}
     ],
     Children = SecondarySupervisors ++ [
         begin


[2/2] git commit: updated refs/heads/1867-feature-plugins-jhs to b837e34

Posted by jh...@apache.org.
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-jhs
Commit: b837e34813a6b8b2c379a4082ea58e1e4f306b8c
Parents: 23d0199
Author: Jason Smith (work) <ja...@gmail.com>
Authored: Mon Aug 19 13:16:40 2013 +0000
Committer: Jason Smith (work) <ja...@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) ->