insights-api-common 5.0.5 → 5.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b8a770535b65f1da98fa3196078052c5048bd13dcd4253145aa04afa5d6c1bf9
4
- data.tar.gz: 13f54d55fe5343eaec0116095014e3782232e836e8e1d610a1e1120ea59b68b8
3
+ metadata.gz: 43e76c5bf47d65b4040b8ed210158adaae8730ea0ceca8a5bd51816d6572e75c
4
+ data.tar.gz: eca7c58f7e1c6051ed91d31a77e37f7559113aaedc54d6640f5986efc23557cf
5
5
  SHA512:
6
- metadata.gz: d329437271a364dc4d03b31b484400c2ab496b91a17f2e39c80fd57c249a992b7e6764b69724677120fe1de219c315472835809df5001a348fd264bb66a8961c
7
- data.tar.gz: 93510825434809fde1d60e46b73a8f80f61535d41d77f8ebe2df716e26212d1903a0f9d9911f328bf4e6607c6aaa5a64aea46617ad39a763819f6325cab851d7
6
+ metadata.gz: '081dae0fe687ba670fc6f6f1ca3a15ce399c99b7c55bc6297cce261a818189bbb6674d44e96c93296394780c25169cd214680c42dc941b0ab83c6dcfe37df246'
7
+ data.tar.gz: d2f112e2339e2398c761e08f447e2aed84ba4a7b15c2ec7fc9371d9aea6602afdb4c9f6ec96ead262e2879ee6f849ab572a20aa1582180f13265899ab98bb245
@@ -2,14 +2,27 @@ module Insights
2
2
  module API
3
3
  module Common
4
4
  class Logging
5
- def self.activate(config)
6
- require 'manageiq/loggers'
7
- config.logger = if Rails.env.production?
8
- config.colorize_logging = false
9
- ManageIQ::Loggers::CloudWatch.new
10
- else
11
- ManageIQ::Loggers::Base.new(Rails.root.join("log", "#{Rails.env}.log"))
12
- end
5
+ def self.logger_class
6
+ if ENV['LOG_HANDLER'] == "haberdasher"
7
+ "Insights::Loggers::StdErrorLogger"
8
+ else
9
+ "Insights::Loggers::CloudWatch"
10
+ end
11
+ end
12
+
13
+ def self.activate(config, app_name = nil)
14
+ require 'insights/loggers'
15
+ log_params = {}
16
+ klass_for_logger = if Rails.env.production?
17
+ config.colorize_logging = false
18
+ log_params[:app_name] = app_name if app_name
19
+ logger_class
20
+ else
21
+ log_params = {:log_path => Rails.root.join("log", "#{Rails.env}.log")}
22
+ "ManageIQ::Loggers::Base"
23
+ end
24
+
25
+ config.logger = Insights::Loggers::Factory.create_logger(klass_for_logger, log_params)
13
26
  end
14
27
  end
15
28
  end
@@ -1,7 +1,7 @@
1
1
  module Insights
2
2
  module API
3
3
  module Common
4
- VERSION = "5.0.5".freeze
4
+ VERSION = "5.0.6".freeze
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: insights-api-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.5
4
+ version: 5.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Insights Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-18 00:00:00.000000000 Z
11
+ date: 2021-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: acts_as_tenant
@@ -73,33 +73,19 @@ dependencies:
73
73
  - !ruby/object:Gem::Version
74
74
  version: 5.2.2.1
75
75
  - !ruby/object:Gem::Dependency
76
- name: manageiq-loggers
76
+ name: insights-loggers-ruby
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '0.3'
81
+ version: 0.1.10
82
82
  type: :runtime
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: '0.3'
89
- - !ruby/object:Gem::Dependency
90
- name: cloudwatchlogger
91
- requirement: !ruby/object:Gem::Requirement
92
- requirements:
93
- - - "~>"
94
- - !ruby/object:Gem::Version
95
- version: 0.2.1
96
- type: :runtime
97
- prerelease: false
98
- version_requirements: !ruby/object:Gem::Requirement
99
- requirements:
100
- - - "~>"
101
- - !ruby/object:Gem::Version
102
- version: 0.2.1
88
+ version: 0.1.10
103
89
  - !ruby/object:Gem::Dependency
104
90
  name: prometheus_exporter
105
91
  requirement: !ruby/object:Gem::Requirement