Class: Loga::Configuration
- Inherits:
-
Object
- Object
- Loga::Configuration
- Defined in:
- lib/loga/configuration.rb
Constant Summary collapse
- FRAMEWORK_EXCEPTIONS =
%w[ ActionController::RoutingError ActiveRecord::RecordNotFound Sinatra::NotFound ].freeze
Instance Attribute Summary collapse
-
#device ⇒ Object
Returns the value of attribute device.
-
#filter_exceptions ⇒ Object
Returns the value of attribute filter_exceptions.
-
#filter_parameters ⇒ Object
Returns the value of attribute filter_parameters.
-
#format ⇒ Object
Returns the value of attribute format.
-
#hide_pii ⇒ Object
Returns the value of attribute hide_pii.
-
#host ⇒ Object
Returns the value of attribute host.
-
#level ⇒ Object
Returns the value of attribute level.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#service_name ⇒ Object
Returns the value of attribute service_name.
-
#service_version ⇒ Object
Returns the value of attribute service_version.
-
#sync ⇒ Object
Returns the value of attribute sync.
-
#tags ⇒ Object
Returns the value of attribute tags.
Instance Method Summary collapse
-
#initialize(user_options = {}, framework_options = {}) ⇒ Configuration
constructor
rubocop:disable Metrics/MethodLength.
- #structured? ⇒ Boolean
Constructor Details
#initialize(user_options = {}, framework_options = {}) ⇒ Configuration
rubocop:disable Metrics/MethodLength
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/loga/configuration.rb', line 22 def initialize( = {}, = {}) = .merge() .merge() .merge() self.device = [:device] self.filter_exceptions = [:filter_exceptions] self.filter_parameters = [:filter_parameters] self.format = [:format] self.host = [:host] self.level = [:level] self.service_name = [:service_name] self.service_version = [:service_version] || ServiceVersionStrategies.call self.sync = [:sync] self. = [:tags] self.hide_pii = [:hide_pii] validate @logger = initialize_logger end |
Instance Attribute Details
#device ⇒ Object
Returns the value of attribute device.
17 18 19 |
# File 'lib/loga/configuration.rb', line 17 def device @device end |
#filter_exceptions ⇒ Object
Returns the value of attribute filter_exceptions.
17 18 19 |
# File 'lib/loga/configuration.rb', line 17 def filter_exceptions @filter_exceptions end |
#filter_parameters ⇒ Object
Returns the value of attribute filter_parameters.
17 18 19 |
# File 'lib/loga/configuration.rb', line 17 def filter_parameters @filter_parameters end |
#format ⇒ Object
Returns the value of attribute format.
19 20 21 |
# File 'lib/loga/configuration.rb', line 19 def format @format end |
#hide_pii ⇒ Object
Returns the value of attribute hide_pii.
17 18 19 |
# File 'lib/loga/configuration.rb', line 17 def hide_pii @hide_pii end |
#host ⇒ Object
Returns the value of attribute host.
17 18 19 |
# File 'lib/loga/configuration.rb', line 17 def host @host end |
#level ⇒ Object
Returns the value of attribute level.
17 18 19 |
# File 'lib/loga/configuration.rb', line 17 def level @level end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
19 20 21 |
# File 'lib/loga/configuration.rb', line 19 def logger @logger end |
#service_name ⇒ Object
Returns the value of attribute service_name.
19 20 21 |
# File 'lib/loga/configuration.rb', line 19 def service_name @service_name end |
#service_version ⇒ Object
Returns the value of attribute service_version.
17 18 19 |
# File 'lib/loga/configuration.rb', line 17 def service_version @service_version end |
#sync ⇒ Object
Returns the value of attribute sync.
17 18 19 |
# File 'lib/loga/configuration.rb', line 17 def sync @sync end |
#tags ⇒ Object
Returns the value of attribute tags.
17 18 19 |
# File 'lib/loga/configuration.rb', line 17 def @tags end |
Instance Method Details
#structured? ⇒ Boolean
53 54 55 |
# File 'lib/loga/configuration.rb', line 53 def structured? format == :gelf end |