Recently, I find out tagged logger. It is a very useful option and I config in production environment.
# config/environments/production.rb
...
config.log_tags = [ :uuid,:remote_ip ]
...
# log/production.log
[4d23e817-eca8-4db1-ba5b-7456d3af7f65] [127.0.0.1] Started GET "/resources/id" for 127.0.0.1 at 2015-11-26 21:09:11 +0900
I also want to print current login user name to log file, so I tried and found a link How to log user_name in Rails?.
But It's not working for me.
I'm using devise and rails4. How do I print?
Thanks in advance.