Skip to content

Commit c0f3503

Browse files
authored
Enhance loggable output with query_params field (#32)
Add query_params field to loggable output with formatted value.
1 parent 461e6d0 commit c0f3503

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,15 @@ This configuration will give you some nice views, and searches to work with the
205205
show do
206206
include_fields :loggable, :method, :path, :response_code
207207
field(:created_at)
208+
field(:query_params) do
209+
formatted_value do
210+
params = bindings[:object].path.split("?").second
211+
if params.present?
212+
params = CGI.parse(params)
213+
"<pre>#{JSON.pretty_generate(params)}</pre>".html_safe
214+
end
215+
end
216+
end
208217
field(:request_body) do
209218
formatted_value { "<pre>#{JSON.pretty_generate(bindings[:object].request_body)}</pre>".html_safe }
210219
end

0 commit comments

Comments
 (0)