---
title: "Standard library logging"
description: "Learn how to send Ruby stdlib Logger output to Sentry as structured logs."
url: https://docs.sentry.io/platforms/ruby/guides/resque/integrations/logging/
---

# Standard library logging | Sentry for Resque

Sentry Structured Logs are enabled by default after the SDK is initialized. You can search, filter, and analyze logs from across your application in one place.

To capture logs from all loggers that use Ruby [Logger](https://ruby-doc.org/3.4.1/stdlibs/logger/Logger.html), enable the `:logger` patch:

```ruby
Sentry.init do |config|
  config.dsn = "https://<key>@o<orgId>.ingest.sentry.io/<projectId>"
  config.enabled_patches << :logger
end
```

Then all logs from `Logger` instances will be sent to Sentry, for example:

```ruby
logger = Logger.new($stdout)

logger.debug("Hello from stdlib logger")
logger.info("Hello from stdlib logger")
logger.error("Hello from stdlib logger")
```

You can filter which logs are sent to Sentry using the [`std_lib_logger_filter`](https://docs.sentry.io/platforms/ruby/configuration/options.md#std-lib-logger-filter) configuration option.

##### Note on structured logging

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.
