San Jose, USA

2066 N Capitol Ave #1117
San Jose, CA 95132

Pune, India

Office #803, 8th Floor, Tower 2
World Trade Center, Kharadi
Pune, Maharashtra 411014
India

hello@BigBinary.com
Ruby on Rails

#7 - Use uuid, X-Request-Id and tagged logging

Episode Notes

Use uuid and tagged logging to debug Rails application.

#config/intializers/tagged_logging.rb

Wheel::Application.config.log_tags = [ :subdomain, :uuid ]

#app/controllers/application_controller.rb

before_action :set_honeybadger_context

def set_honeybadger_context hash = { uuid: request.uuid }

if current_user hash.merge!({ user_id: current_user.id, user_email: current_user.email }) end

Honeybadger.context hash end