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

Adding documentation on how to enable param logging #68

Merged
merged 2 commits into from
Sep 17, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class ApplicationController < ActionController::Base
end
```

To further clean up your logging, you can also tell Lograge to skip log messages
To further clean up your logging, you can also tell Lograge to skip log messages
meeting given criteria. You can skip log messages generated from certain controller
actions, or you can write a custom handler to skip messages based on data in the log event:

Expand Down Expand Up @@ -220,6 +220,23 @@ Lograge doesn't yet log the request parameters. This is something I'm actively
contemplating, mainly because I want to find a good way to include them, a way
that fits in with the general spirit of the log output generated by Lograge.

In the meantime, if you want to log parameters in your application, you can use
the following snippet:

```ruby
# production.rb
YourApp::Application.configure do
config.lograge.enabled = true
config.lograge.custom_options = lambda do |event|
params = event.payload[:params].reject do |k|
['controller', 'action'].include? k
end

{ "params" => params }
end
end
```
Copy link
Collaborator

Choose a reason for hiding this comment

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

You're missing an end to close the configure block.


**Changes**

* Add support for Graylog2 events (Lennart Koopmann, http://github.com/lennartkoopmann)
Expand Down