Do not include context parameters which are nil in any log entries. Fixed session_id so it works on Rails 3.2 and Rails 4.