Class: Sentry::Rails::StructuredLoggingConfiguration

Inherits:
Object
  • Object
show all
Defined in:
lib/sentry/rails/configuration.rb

Constant Summary collapse

DEFAULT_SUBSCRIBERS =
{
  active_record: Sentry::Rails::LogSubscribers::ActiveRecordSubscriber,
  action_controller: Sentry::Rails::LogSubscribers::ActionControllerSubscriber
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeStructuredLoggingConfiguration

Returns a new instance of StructuredLoggingConfiguration.



207
208
209
210
# File 'lib/sentry/rails/configuration.rb', line 207

def initialize
  @enabled = nil
  @subscribers = DEFAULT_SUBSCRIBERS.dup
end

Instance Attribute Details

#enabledBoolean

Enable or disable structured logging

Returns:

  • (Boolean)


196
197
198
# File 'lib/sentry/rails/configuration.rb', line 196

def enabled
  @enabled
end

#subscribersHash<Symbol, Class>

Hash of components to subscriber classes for structured logging

Returns:

  • (Hash<Symbol, Class>)


200
201
202
# File 'lib/sentry/rails/configuration.rb', line 200

def subscribers
  @subscribers
end

Instance Method Details

#enabled?Boolean

Returns true if structured logging should be enabled.

Returns:

  • (Boolean)


214
215
216
# File 'lib/sentry/rails/configuration.rb', line 214

def enabled?
  enabled
end