zuora_connect 1.7.81y → 1.7.81z
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b3981851d33ab348f316691961b5c7d285f484f694410a3346680c311ffe9e8
|
4
|
+
data.tar.gz: 8d420ab07b185af43e065328b06e3d6b298451bae6f1594371b4e307872d8849
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8142f4739b94aee5175713bd694fbdb239ca99b7aeb708290da0f1ba3c2e1aaeb1fc6f909f17b04afffe80ecc0a193e31b34fed45824c5c0849f3aa4a9fe107
|
7
|
+
data.tar.gz: 1aa946e26d50d4bedaf7828711b662921164b13469a77c8894dc0801a8daf0c2dd9cf586e3d651d347f50a7febbae153803ac54db3218200a28ace12b3c7d5b5
|
@@ -26,6 +26,19 @@ module ZuoraConnect
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def health
|
29
|
+
if params[:error].present?
|
30
|
+
begin
|
31
|
+
raise ZuoraConnect::Exceptions::Error.new('This is an error')
|
32
|
+
rescue => ex
|
33
|
+
case params[:error]
|
34
|
+
when 'Log'
|
35
|
+
Rails.logger.error(ex)
|
36
|
+
when 'Exception'
|
37
|
+
raise
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
29
42
|
render json: {
|
30
43
|
message: "Alive",
|
31
44
|
status: 200
|
@@ -7,7 +7,7 @@ module Resque
|
|
7
7
|
module Plugins
|
8
8
|
module CustomLogger
|
9
9
|
def before_perform(*args)
|
10
|
-
Rails.logger.with_fields = { trace_id: SecureRandom.uuid, name: "RailsWorker"} if Rails.
|
10
|
+
Rails.logger.with_fields = { trace_id: SecureRandom.uuid, name: "RailsWorker"} if Rails.logger.class.to_s == 'Ougai::Logger'
|
11
11
|
case args.class.to_s
|
12
12
|
when "Array"
|
13
13
|
if args.first.class == Hash
|
@@ -18,7 +18,9 @@ module Resque
|
|
18
18
|
when "Hash"
|
19
19
|
data = args.merge({:worker_class => self.to_s})
|
20
20
|
end
|
21
|
-
|
21
|
+
data = {:msg => 'Starting job', :job => data}
|
22
|
+
data.merge!({:app_instance_id => data.dig(:job, 'app_instance_id')}) if data.dig(:job, 'app_instance_id').present?
|
23
|
+
Rails.logger.info(data) if data.present?
|
22
24
|
end
|
23
25
|
end
|
24
26
|
end
|
data/lib/zuora_connect.rb
CHANGED
@@ -39,6 +39,14 @@ module ZuoraConnect
|
|
39
39
|
logger.level = level
|
40
40
|
logger.before_log = lambda do |data|
|
41
41
|
data[:trace_id] = ZuoraConnect::RequestIdMiddleware.request_id if ZuoraConnect::RequestIdMiddleware.request_id.present?
|
42
|
+
if Thread.current[:appinstance].present?
|
43
|
+
data[:app_instance_id] = Thread.current[:appinstance].id
|
44
|
+
logitems = Thread.current[:appinstance].logitems
|
45
|
+
if logitems.present? && logitems.class == Hash
|
46
|
+
data[:tenant_ids] = logitems[:tenant_ids] if logitems[:tenant_ids].present?
|
47
|
+
data[:organization] = logitems[:organization] if logitems[:organization].present?
|
48
|
+
end
|
49
|
+
end
|
42
50
|
end
|
43
51
|
else
|
44
52
|
logger = MonoLogger.new(STDOUT)
|
@@ -50,13 +58,22 @@ module ZuoraConnect
|
|
50
58
|
end
|
51
59
|
|
52
60
|
require 'json'
|
53
|
-
|
61
|
+
store = {
|
54
62
|
name: name,
|
55
63
|
level: serverity,
|
56
64
|
timestamp: datetime.strftime('%FT%T.%6NZ'),
|
57
65
|
pid: Process.pid,
|
58
66
|
message: name == "ActionMailer" ? msg.strip : msg
|
59
|
-
|
67
|
+
}
|
68
|
+
if Thread.current[:appinstance].present?
|
69
|
+
store[:app_instance_id] = Thread.current[:appinstance].id
|
70
|
+
logitems = Thread.current[:appinstance].logitems
|
71
|
+
if logitems.present? && logitems.class == Hash
|
72
|
+
store[:tenant_ids] = logitems[:tenant_ids] if logitems[:tenant_ids].present?
|
73
|
+
store[:organization] = logitems[:organization] if logitems[:organization].present?
|
74
|
+
end
|
75
|
+
end
|
76
|
+
JSON.dump(store) + "\n"
|
60
77
|
end
|
61
78
|
end
|
62
79
|
return logger
|
@@ -50,11 +50,11 @@ module ZuoraConnect
|
|
50
50
|
exceptions = %w(controller action format id)
|
51
51
|
items = {
|
52
52
|
#time: event.time.strftime('%FT%T.%6N'),
|
53
|
-
params: event.payload[:params].except(*exceptions)
|
54
|
-
exception: event.payload[:exception],
|
55
|
-
exception_object: event.payload[:exception_object],
|
56
|
-
process_id: Process.pid
|
53
|
+
params: event.payload[:params].except(*exceptions).to_json.to_s
|
57
54
|
}
|
55
|
+
items.merge!({exception_object: event.payload[:exception_object]}) if event.payload[:exception_object].present?
|
56
|
+
items.merge!({exception: event.payload[:exception]}) if event.payload[:exception].present?
|
57
|
+
|
58
58
|
if Thread.current[:appinstance].present?
|
59
59
|
items.merge!({appinstance_id: Thread.current[:appinstance].id, connect_user: Thread.current[:appinstance].connect_user, new_session: Thread.current[:appinstance].new_session_message})
|
60
60
|
if Thread.current[:appinstance].logitems.present? && Thread.current[:appinstance].logitems.class == Hash
|