Skip to content

Commit 679bc75

Browse files
committed
Add before_send_log to Options section too
1 parent ab15fbc commit 679bc75

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

docs/platforms/ruby/common/configuration/options.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,14 @@ Provides a lambda or proc that's called with an SDK-specific transaction event o
342342

343343
</SdkOption>
344344

345+
<SdkOption name="before_send_log" type="lambda | proc">
346+
347+
Provides a lambda or proc that's called with an SDK-specific log object, and can return a modified log object, or `nil` to skip reporting the log. This can be used to filter logs before they are sent to Sentry.
348+
349+
<PlatformContent includePath="configuration/before-send-log/" />
350+
351+
</SdkOption>
352+
345353
<SdkOption name="backtrace_cleanup_callback" type="lambda">
346354

347355
If you want to clean up the backtrace of an exception before it's sent to Sentry, you can specify a callback with `backtrace_cleanup_callback`, for example:
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
```ruby
2+
Sentry.init do |config|
3+
config.dsn = "___PUBLIC_DSN___"
4+
config.enable_logs = true
5+
6+
config.before_send_log = lambda do |log|
7+
# Skip info logs
8+
return if log.level == :info
9+
10+
log
11+
end
12+
end
13+
```
14+

platform-includes/logs/options/ruby.rails.mdx

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,7 @@
22

33
To filter logs before they are sent to Sentry, use the `before_send_log` callback. Return `nil` to skip a log, or return the log object to send it.
44

5-
```ruby
6-
Sentry.init do |config|
7-
config.dsn = "___PUBLIC_DSN___"
8-
config.enable_logs = true
9-
10-
config.before_send_log = lambda do |log|
11-
# Skip info logs
12-
return if log.level == :info
13-
14-
log
15-
end
16-
end
17-
```
5+
<PlatformContent includePath="configuration/before-send-log" />
186

197
### Structured Logging Subscribers
208

0 commit comments

Comments
 (0)