Class: Logsy::Configuration

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

Constant Summary collapse

DEFAULT_IGNORED_CALLER_PATHS =
[
  %r{/logger\.rb\z},
  %r{/active_support/(tagged_logging|logger|broadcast_logger|log_subscriber)},
  %r{/lograge/},
  %r{/sprockets/},
  %r{/quiet_assets/},
  %r{/lib/logsy/}
].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/logsy/configuration.rb', line 22

def initialize
  @job_propagated_keys        = [:request_id]
  @ignored_caller_paths       = DEFAULT_IGNORED_CALLER_PATHS.dup
  @include_caller_location    = true
  @request_summary_event_name = 'request'
  # How many stack frames to inspect before giving up on attributing
  # the log line to app code. App frames sit within a few dozen frames
  # of the logger; framework-only lines (no app frame at all) would
  # otherwise pay a full walk of a 100+ deep Rails stack on every line.
  @caller_location_max_depth  = 64
end

Instance Attribute Details

#caller_location_max_depthObject

Tag keys that should be carried across job boundaries (e.g. when a background job is enqueued from a web request, the job inherits these). The middleware that does the actual carrying is job-runner specific (Logsy ships one for Sidekiq).



18
19
20
# File 'lib/logsy/configuration.rb', line 18

def caller_location_max_depth
  @caller_location_max_depth
end

#ignored_caller_pathsObject

Tag keys that should be carried across job boundaries (e.g. when a background job is enqueued from a web request, the job inherits these). The middleware that does the actual carrying is job-runner specific (Logsy ships one for Sidekiq).



18
19
20
# File 'lib/logsy/configuration.rb', line 18

def ignored_caller_paths
  @ignored_caller_paths
end

#include_caller_locationObject

Tag keys that should be carried across job boundaries (e.g. when a background job is enqueued from a web request, the job inherits these). The middleware that does the actual carrying is job-runner specific (Logsy ships one for Sidekiq).



18
19
20
# File 'lib/logsy/configuration.rb', line 18

def include_caller_location
  @include_caller_location
end

#job_propagated_keysObject

Tag keys that should be carried across job boundaries (e.g. when a background job is enqueued from a web request, the job inherits these). The middleware that does the actual carrying is job-runner specific (Logsy ships one for Sidekiq).



18
19
20
# File 'lib/logsy/configuration.rb', line 18

def job_propagated_keys
  @job_propagated_keys
end

#request_summary_event_nameObject

Tag keys that should be carried across job boundaries (e.g. when a background job is enqueued from a web request, the job inherits these). The middleware that does the actual carrying is job-runner specific (Logsy ships one for Sidekiq).



18
19
20
# File 'lib/logsy/configuration.rb', line 18

def request_summary_event_name
  @request_summary_event_name
end