class ProxyLogger

Ruby on Rails edge

Since edge

Active Support Proxy Logger

The proxy logger, is a logger that forwards all received logs to another logger, but has its own independent severity level.

This is useful when you want some library you have no control over to use the same logger as the rest of your application, but to have a different severity level because it is logging too much:

SomeLibrary.logger = ActiveSupport::ProxyLogger.new(Rails.logger, :error)

It can also ignore individual messages matching given patterns, when a library is only noisy on some logs your application doesn’t care about:

SomeLibrary.logger = ActiveSupport::ProxyLogger.new(Rails.logger).ignore(/Noisy/)

Almost all of the standard Logger interface is supported.

Note that the proxy logger can only suppress some logs, if the proxy severity is lower than the severity of the proxied logger, the logs won’t be emitted.

Inherits from

Object

Includes

Methods (defined here)

Methods (inherited)

From ActiveSupport::LoggerSilence (1)
From Object (17)
From ActiveSupport::Concern (3)
From ActiveSupport::NumericWithFormat (2)

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close