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

Format rack-attack logging as JSON #1444

Merged
merged 1 commit into from
May 19, 2017

Conversation

zachmargolis
Copy link
Contributor

Why:
Was previously being logged as a Ruby hash, which ELK doesn't parse

Tested by tailing log/development.log

before:

{:discriminator=>nil, :event=>"throttle", :type=>"allow from localhost", :user_ip=>"127.0.0.1"}

after:

{"discriminator":null,"event":"throttle","type":"allow from localhost","user_ip":"127.0.0.1"}

Copy link
Contributor

@monfresh monfresh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm % minor Code Climate issue

@monfresh
Copy link
Contributor

Also, I believe you might need to update the tests. They expect a Hash, not JSON.

**Why**:
Was previously being logged as a Ruby hash, which ELK doesn't parse
@zachmargolis zachmargolis force-pushed the margolis-json-format-rack-attack branch from 531cb7c to 5f11d39 Compare May 19, 2017 19:41
@zachmargolis
Copy link
Contributor Author

@monfresh thanks! updated the tests

@zachmargolis zachmargolis merged commit 5f28e14 into master May 19, 2017
@zachmargolis zachmargolis deleted the margolis-json-format-rack-attack branch May 19, 2017 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants