Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging / not logging controller params hash #81

Open
tamouse opened this issue Aug 10, 2015 · 1 comment
Open

Logging / not logging controller params hash #81

tamouse opened this issue Aug 10, 2015 · 1 comment

Comments

@tamouse
Copy link

tamouse commented Aug 10, 2015

In #20 and the README indicating there might be issues with logging the params hash, I'm a bit concerned, as most of the problems I encounter have needed the params hash to discover the source of the errors. I don't want to explode my logs OR lose log records, neither is useful.

Is there an alternative I can use that let's me still view the params hash, but doesn't cause either of those problems to show up? For example, could I somehow have them logged simply as a custom value converted to a string?

@ibrahima
Copy link

ibrahima commented Apr 6, 2016

I think one potential solution is to not enable parameter logging, but instead do something like this in your initializer: (ref #66)

fields[:params] = request.filtered_parameters.to_json

That should give you a json string instead of nested fields. But I'm not 100% sure if logstash won't try to parse that JSON, but my guess is that it shouldn't, because the second layer of JSON encoding should entity-ify the params JSON.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants