Is there a way to add the session id to each log in Rails. Now, I've added this in my environment.rb: class Logger def format_message(severity, timestamp, progname, msg) "#{timestamp.to_formatted_s(:db)} #{severity} #{msg}\n" end end First of all, is this best-practice? And how do I add the session id?