Class: CoreLibrary::BaseHttpLoggingConfiguration

Inherits:
Object
  • Object
show all
Defined in:
lib/apimatic-core/logger/configurations/api_logging_configuration.rb

Overview

Represents configuration for logging HTTP messages.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(log_body, log_headers, headers_to_exclude, headers_to_include, headers_to_unmask) ⇒ BaseHttpLoggingConfiguration

Initializes a new instance of BaseHttpLoggingConfiguration.

Parameters:

  • log_body (Boolean)

    Indicates whether the message body should be logged. Default is false.

  • log_headers (Boolean)

    Indicates whether the message headers should be logged. Default is false.

  • headers_to_exclude (Array<String>)

    Array of headers not displayed in logging. Default is an empty array.

  • headers_to_include (Array<String>)

    Array of headers to be displayed in logging. Default is an empty array.

  • headers_to_unmask (Array<String>)

    Array of headers which values are non-sensitive to display in logging. Default is an empty array.



40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/apimatic-core/logger/configurations/api_logging_configuration.rb', line 40

def initialize(
  log_body,
  log_headers,
  headers_to_exclude,
  headers_to_include,
  headers_to_unmask
)
  @log_body = log_body
  @log_headers = log_headers
  @headers_to_exclude = headers_to_exclude || []
  @headers_to_include = headers_to_include || []
  @headers_to_unmask = headers_to_unmask || []
end

Instance Attribute Details

#headers_to_excludeObject (readonly)

Returns the value of attribute headers_to_exclude.



30
31
32
# File 'lib/apimatic-core/logger/configurations/api_logging_configuration.rb', line 30

def headers_to_exclude
  @headers_to_exclude
end

#headers_to_includeObject (readonly)

Returns the value of attribute headers_to_include.



30
31
32
# File 'lib/apimatic-core/logger/configurations/api_logging_configuration.rb', line 30

def headers_to_include
  @headers_to_include
end

#headers_to_unmaskObject (readonly)

Returns the value of attribute headers_to_unmask.



30
31
32
# File 'lib/apimatic-core/logger/configurations/api_logging_configuration.rb', line 30

def headers_to_unmask
  @headers_to_unmask
end

#log_bodyObject (readonly)

Returns the value of attribute log_body.



30
31
32
# File 'lib/apimatic-core/logger/configurations/api_logging_configuration.rb', line 30

def log_body
  @log_body
end

#log_headersObject (readonly)

Returns the value of attribute log_headers.



30
31
32
# File 'lib/apimatic-core/logger/configurations/api_logging_configuration.rb', line 30

def log_headers
  @log_headers
end