lib/kiev/logger.rb in kiev-4.3.0 vs lib/kiev/logger.rb in kiev-4.4.0

- old
+ new

@@ -21,10 +21,11 @@ { application: Config.instance.app, event: event_name || DEFAULT_EVENT_NAME, level: severity, timestamp: time.utc, + tracking_id: RequestStore.store[:tracking_id], request_id: RequestStore.store[:request_id], request_depth: RequestStore.store[:request_depth], tree_path: RequestStore.store[:tree_path] } @@ -90,13 +91,11 @@ entry << "- #{status}" if status duration = data.is_a?(Hash) ? data.delete(:request_duration) : nil entry << "(#{duration}ms)" if duration entry << "\n" - meta = { - request_id: RequestStore.store[:request_id], - request_depth: RequestStore.store[:request_depth] - }.merge!(Hash(RequestStore.store[:payload])) + meta = RequestStore.store.slice(:trakcing_id, :request_id, :request_depth) + .reverse_merge!(Hash(RequestStore.store[:payload])) meta.reject! { |_, value| value.nil? } entry << " Meta: #{meta.inspect}\n"