Skip to content

Commit

Permalink
Merge pull request #68 from iloveitaly/param-logging-docs
Browse files Browse the repository at this point in the history
Adding documentation on how to enable param logging
  • Loading branch information
Ben Lovell committed Sep 17, 2014
2 parents b295119 + 8f8bf2a commit 9265850
Showing 1 changed file with 18 additions and 1 deletion.
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 @@ -221,6 +221,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
```

**Changes**

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

0 comments on commit 9265850

Please sign in to comment.