Class: Timber::Contexts::Session
- Inherits:
-
Timber::Context
- Object
- Timber::Context
- Timber::Contexts::Session
- Defined in:
- lib/timber/contexts/session.rb
Overview
Note:
This is tracked automatically with the Integrations::Rack::SessionContext rack middleware.
The session context adds the current session ID to your logs. This allows you to tail and filter logs by specific session IDs. Moreover, it gives you a unique identifier to report on user activity by session. This way your logs can tell the story of how many time a user has engaged your site.
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
-
#as_json(_options = {}) ⇒ Object
Builds a hash representation containing simple objects, suitable for serialization (JSON).
-
#initialize(attributes) ⇒ Session
constructor
A new instance of Session.
Constructor Details
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
16 17 18 |
# File 'lib/timber/contexts/session.rb', line 16 def id @id end |
Instance Method Details
#as_json(_options = {}) ⇒ Object
Builds a hash representation containing simple objects, suitable for serialization (JSON).
23 24 25 |
# File 'lib/timber/contexts/session.rb', line 23 def as_json( = {}) {id: id} end |