README.md in l2meter-0.9.1 vs README.md in l2meter-0.10.0
- old
+ new
@@ -204,9 +204,31 @@
# ...
Metrics.count :users, 100500 # => count#my-app.users=100500
```
+## Scrubbing
+
+L2meter allows plugging in custom scrubbing logic that might be useful in
+environments where logging compliance is important.
+
+```ruby
+config.scrubber = ->(key, value) do
+ begin
+ uri = URI.parse(value)
+ uri.password = "scrubbed" if uri.password
+ uri.to_s
+ rescue URI::Error
+ value
+ end
+end
+
+Metric.log my_url: "https://user:password@example.com"
+# => my-url="https://user:redacted@example.com"
+```
+
+Note that returning nil value will make l2meter omit the field completely.
+
## Silence
There's a way to temporary silence the log emitter. This might be userful for
tests for example.