aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_http_rest.erl
diff options
context:
space:
mode:
authorMagnus Klaar <[email protected]>2012-03-31 11:04:52 -0700
committerLoïc Hoguin <[email protected]>2012-04-01 17:57:00 +0200
commit5a7040ee1ce1c8413fcf372fd58c2010fcca3795 (patch)
treece91177efa909690fb297b8e5403dabe5a120009 /src/cowboy_http_rest.erl
parent4fb2a6face6e7d6ff1dd34a02c3bd8b63d972624 (diff)
downloadcowboy-5a7040ee1ce1c8413fcf372fd58c2010fcca3795.tar.gz
cowboy-5a7040ee1ce1c8413fcf372fd58c2010fcca3795.tar.bz2
cowboy-5a7040ee1ce1c8413fcf372fd58c2010fcca3795.zip
Convert request to proplist when logging
Diffstat (limited to 'src/cowboy_http_rest.erl')
-rw-r--r--src/cowboy_http_rest.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cowboy_http_rest.erl b/src/cowboy_http_rest.erl
index c19d838..f9c856a 100644
--- a/src/cowboy_http_rest.erl
+++ b/src/cowboy_http_rest.erl
@@ -68,11 +68,12 @@ upgrade(_ListenerPid, Handler, Opts, Req) ->
service_available(Req, #state{handler=Handler})
end
catch Class:Reason ->
+ PLReq = lists:zip(record_info(fields, http_req), tl(tuple_to_list(Req))),
error_logger:error_msg(
"** Handler ~p terminating in rest_init/3~n"
" for the reason ~p:~p~n** Options were ~p~n"
"** Request was ~p~n** Stacktrace: ~p~n~n",
- [Handler, Class, Reason, Opts, Req, erlang:get_stacktrace()]),
+ [Handler, Class, Reason, Opts, PLReq, erlang:get_stacktrace()]),
{ok, _Req2} = cowboy_http_req:reply(500, Req),
close
end.