Class: Sidekiq::SemanticLogging
- Inherits:
-
JobLogger
- Object
- JobLogger
- Sidekiq::SemanticLogging
- Defined in:
- lib/sidekiq/semantic_logging.rb
Instance Method Summary collapse
- #call(_worker, item, queue) ⇒ Object
-
#initialize ⇒ SemanticLogging
constructor
A new instance of SemanticLogging.
Constructor Details
#initialize ⇒ SemanticLogging
Returns a new instance of SemanticLogging.
7 8 9 10 |
# File 'lib/sidekiq/semantic_logging.rb', line 7 def initialize logger = Rails.logger super(logger) end |
Instance Method Details
#call(_worker, item, queue) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/sidekiq/semantic_logging.rb', line 12 def call(_worker, item, queue) = { class: item['class'], jid: item['jid'], request_id: item['request_id'], remote_ip: item['remote_ip'], user_agent: item['user_agent'], user_uuid: item['user_uuid'] || 'N/A', source: item['source'] } Thread.current[:sidekiq_context] = {} @logger.tagged(**) do super(item, queue) end end |