Sha256: ca523c2eaf009ca5a852214aeb72e5a1dbfa7d40b91ce9a8b19c8d189616d1ae
Contents?: true
Size: 661 Bytes
Versions: 14
Compression:
Stored size: 661 Bytes
Contents
module TwirpRails class LogSubscriber < ActiveSupport::LogSubscriber cattr_accessor :log_writer def instrumenter(event) if LogSubscriber.log_writer LogSubscriber.log_writer.call(event) else default_log_writer(event) end end def default_log_writer(event) twirp_call_info = { 'duration' => event.duration, 'method' => event.payload[:env][:rpc_method], 'params' => event.payload[:env][:input].to_h } if (exception = event.payload[:env][:exception]) twirp_call_info['exception'] = exception end Rails.logger.info twirp_call_info end end end
Version data entries
14 entries across 14 versions & 1 rubygems