Sha256: c635441b80c78835f6cb16fdc400e6e073e9f3942c54ac436775399a955cc8da
Contents?: true
Size: 733 Bytes
Versions: 10
Compression:
Stored size: 733 Bytes
Contents
module LogSanity module LogSubscriber class ActionCable < Base def process(event) payload = event.payload log 'event', 'ws_connect' log 'status', payload[:status] # logged by the actiondispatch subscriber end def on_close(event) payload = event.payload request = payload[:request] info do e = { 'at' => Time.now, 'event' => 'ws_disconnect', 'ip' => request.remote_ip, 'rq' => request.uuid, 'duration' => {'socket' => "#{payload[:connection_sec].round}s"} } e['reason'] = payload[:reason] if payload[:reason] e end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems