ocean-rails 2.2.1 → 2.3.1
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a249ef526086a2b4e138e5e54d3b1e634671b20
|
4
|
+
data.tar.gz: 3f3dc81fca5f468771891cdd1364d8de15af68c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2a2e8ba731cae49376517c6bd6ac2d25ee0fc7e0a19fce4deaf923c93eb24b43badff2ebc0599b6573d5493aa85d6732305ef9a77618af3a7add1fa8edd474c
|
7
|
+
data.tar.gz: 99218c4cf33998ad2e6cb5212d1fc0bfdefea34555591803f17eb467829aee4d6daab435f013d71e9de49d0a9b4fb917c4a3dea60d6d69817ea31d347b9dd75c
|
@@ -48,9 +48,14 @@ if Rails.env == 'production' && ENV['NO_ZEROMQ_LOGGING'].blank?
|
|
48
48
|
data[:params] = params if params.present?
|
49
49
|
data[:filter] = Thread.current[:filter] if Thread.current[:filter]
|
50
50
|
data[:token] = Thread.current[:x_api_token] if Thread.current[:x_api_token].present?
|
51
|
+
data[:username] = Thread.current[:username] if Thread.current[:username].present?
|
52
|
+
data[:max_age] = Thread.current[:max_age] if Thread.current[:max_age].present?
|
51
53
|
|
52
54
|
Thread.current[:logdata] = data
|
53
55
|
Thread.current[:filter] = nil
|
56
|
+
Thread.current[:x_api_token] = nil
|
57
|
+
Thread.current[:username] = nil
|
58
|
+
Thread.current[:max_age] = nil
|
54
59
|
end
|
55
60
|
end
|
56
61
|
|
@@ -66,6 +66,8 @@ module OceanApplicationController
|
|
66
66
|
if response.status == 200
|
67
67
|
@auth_api_user_id = response.body['authentication']['user_id'] # Deprecate and remove
|
68
68
|
@auth_api_user_uri = response.body['authentication']['_links']['creator']['href'] # Keep
|
69
|
+
Thread.current[:username] = response.body['authentication']['username']
|
70
|
+
Thread.current[:max_age] = response.body['authentication']['max_age']
|
69
71
|
return true
|
70
72
|
end
|
71
73
|
error_messages = response.body['_api_error']
|
data/lib/ocean/version.rb
CHANGED
data/lib/ocean/zeromq_logger.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
data[:token] = Thread.current[:x_api_token] if Thread.current[:x_api_token].present?
|
1
2
|
require 'socket'
|
2
3
|
|
3
4
|
#
|
@@ -80,9 +81,11 @@ class ZeromqLogger
|
|
80
81
|
service: APP_NAME,
|
81
82
|
level: level
|
82
83
|
}
|
83
|
-
data =
|
84
|
+
data[:token] = Thread.current[:x_api_token] if Thread.current[:x_api_token].present?
|
85
|
+
data[:username] = Thread.current[:username] if Thread.current[:username].present?
|
84
86
|
data[:msg] = msg if msg.is_a?(String)
|
85
87
|
data[:timestamp] = (Time.now.utc.to_f * 1000).to_i unless data[:timestamp]
|
88
|
+
data = data.merge msg if msg.is_a?(Hash)
|
86
89
|
@logger.log data
|
87
90
|
true
|
88
91
|
end
|