Class: Timber::Integrations::Rack::HTTPRequest
- Inherits:
-
Object
- Object
- Timber::Integrations::Rack::HTTPRequest
- Defined in:
- lib/timber-rack/http_request.rb
Overview
This event should be installed automatically through integrations, such as the Integrations::ActionController::LogSubscriber integration.
The HTTP server request event tracks incoming HTTP requests to your HTTP server. Such as unicorn, webrick, puma, etc.
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#content_length ⇒ Object
readonly
Returns the value of attribute content_length.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#headers_json ⇒ Object
readonly
Returns the value of attribute headers_json.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#query_string ⇒ Object
readonly
Returns the value of attribute query_string.
-
#request_id ⇒ Object
readonly
Returns the value of attribute request_id.
-
#scheme ⇒ Object
readonly
Returns the value of attribute scheme.
-
#service_name ⇒ Object
readonly
Returns the value of attribute service_name.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ HTTPRequest
constructor
A new instance of HTTPRequest.
- #message ⇒ Object
Constructor Details
#initialize(attributes) ⇒ HTTPRequest
Returns a new instance of HTTPRequest.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/timber-rack/http_request.rb', line 13 def initialize(attributes) @body = attributes[:body] @content_length = attributes[:content_length] @headers = attributes[:headers] @host = attributes[:host] @method = attributes[:method] @path = attributes[:path] @port = attributes[:port] @query_string = attributes[:query_string] @scheme = attributes[:scheme] @request_id = attributes[:request_id] @service_name = attributes[:service_name] if @headers @headers_json = @headers.to_json end end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
10 11 12 |
# File 'lib/timber-rack/http_request.rb', line 10 def body @body end |
#content_length ⇒ Object (readonly)
Returns the value of attribute content_length.
10 11 12 |
# File 'lib/timber-rack/http_request.rb', line 10 def content_length @content_length end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
10 11 12 |
# File 'lib/timber-rack/http_request.rb', line 10 def headers @headers end |
#headers_json ⇒ Object (readonly)
Returns the value of attribute headers_json.
10 11 12 |
# File 'lib/timber-rack/http_request.rb', line 10 def headers_json @headers_json end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
10 11 12 |
# File 'lib/timber-rack/http_request.rb', line 10 def host @host end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
10 11 12 |
# File 'lib/timber-rack/http_request.rb', line 10 def method @method end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
10 11 12 |
# File 'lib/timber-rack/http_request.rb', line 10 def path @path end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
10 11 12 |
# File 'lib/timber-rack/http_request.rb', line 10 def port @port end |
#query_string ⇒ Object (readonly)
Returns the value of attribute query_string.
10 11 12 |
# File 'lib/timber-rack/http_request.rb', line 10 def query_string @query_string end |
#request_id ⇒ Object (readonly)
Returns the value of attribute request_id.
10 11 12 |
# File 'lib/timber-rack/http_request.rb', line 10 def request_id @request_id end |
#scheme ⇒ Object (readonly)
Returns the value of attribute scheme.
10 11 12 |
# File 'lib/timber-rack/http_request.rb', line 10 def scheme @scheme end |
#service_name ⇒ Object (readonly)
Returns the value of attribute service_name.
10 11 12 |
# File 'lib/timber-rack/http_request.rb', line 10 def service_name @service_name end |
Instance Method Details
#message ⇒ Object
31 32 33 |
# File 'lib/timber-rack/http_request.rb', line 31 def 'Started %s "%s"' % [method, path] end |