How to log user_name in Rails?

后端 未结 12 1682
遇见更好的自我
遇见更好的自我 2020-12-15 06:52

I use Devise in Rails 3. I want to see name of current_user in production.log.

I would like to configure rails like this:

config.log_tags = [:user_na         


        
12条回答
  •  伪装坚强ぢ
    2020-12-15 07:45

    As a quick and ugly workaround, maybe one could log a second line after the request has been processed.

    This 500 ServerError has been presented by: #{username}

提交回复
热议问题