Skip to content

Commit 22a5e31

Browse files
committed
Add a note about structured logging
1 parent f6ee58a commit 22a5e31

File tree

1 file changed

+5
-1
lines changed
  • platform-includes/logs/integrations

1 file changed

+5
-1
lines changed

platform-includes/logs/integrations/ruby.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
To enable structured logging for all loggers that use Ruby [Logger](https://ruby-doc.org/3.4.1/stdlibs/logger/Logger.html) you can enable `:logger` patch:
1+
To enable logging for all loggers that use Ruby [Logger](https://ruby-doc.org/3.4.1/stdlibs/logger/Logger.html) you can enable `:logger` patch:
22

33
```ruby
44
Sentry.init do |config|
@@ -18,6 +18,10 @@ logger.info("Hello from stdlib logger")
1818
logger.error("Hello from stdlib logger")
1919
```
2020

21+
<Alert level="info" title="Note on structured logging">
22+
Ruby's stdlib logger does not support structured logging, that's why logs are sent to Sentry as plain messages with default attributes added automatically by the SDK.
23+
</Alert>
24+
2125
## Ruby on Rails
2226

2327
If you enable `:logger` patch like explained above, this will affect Rails' built-in logger. This means that anything that Rails logs, and any custom usage of the Rails logger, will result in sending log entries to Sentry. For example:

0 commit comments

Comments
 (0)