Module: Pliny::RequestStore
- Defined in:
- lib/pliny/request_store.rb
Class Method Summary collapse
Class Method Details
.clear! ⇒ Object
5 6 7 |
# File 'lib/pliny/request_store.rb', line 5 def self.clear! Thread.current[:request_store] = {} end |
.seed(env) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/pliny/request_store.rb', line 9 def self.seed(env) store[:request_id] = env["REQUEST_IDS"]&.join(",") # a global context that evolves over the lifetime of the request, and is # used to tag all log messages that it produces store[:log_context] = { request_id: store[:request_id], } end |
.store ⇒ Object
20 21 22 |
# File 'lib/pliny/request_store.rb', line 20 def self.store Thread.current[:request_store] ||= {} end |