Skip to content

Instantly share code, notes, and snippets.

@rnewson
Created February 12, 2014 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rnewson/8965429 to your computer and use it in GitHub Desktop.
Save rnewson/8965429 to your computer and use it in GitHub Desktop.
diff --git a/src/couch_httpd.erl b/src/couch_httpd.erl
index db90129..45dd524 100644
--- a/src/couch_httpd.erl
+++ b/src/couch_httpd.erl
@@ -582,12 +582,17 @@ verify_is_server_admin(#user_ctx{roles=Roles}) ->
end.
log_request(#httpd{mochi_req=MochiReq,peer=Peer}, Code) ->
- ?LOG_INFO("~s - - ~s ~s ~B", [
- Peer,
- MochiReq:get(method),
- MochiReq:get(raw_path),
- Code
- ]).
+ case erlang:get(dont_log_request) of
+ true ->
+ ok;
+ _ ->
+ couch_log:log(notice, "~s - - ~s ~s ~B", [
+ Peer,
+ MochiReq:get(method),
+ MochiReq:get(raw_path),
+ Code
+ ])
+ end.
start_response_length(#httpd{mochi_req=MochiReq}=Req, Code, Headers, Length) ->
log_request(Req, Code),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment