Typically, this information is added to the access log by the web
server.
The Rails default logging also outputs this information, even in
production mode:
Processing <controller>#<action> (for <user-ip> at
<date-time>) GET
If you want to put this in the Rails log file in your own format, it can
be found in your request.env collection under REMOTE_HOST, e.g.
logger.info "Users IP:
#{request.env[''REMOTE_HOST'']}"
-----Original Message-----
From: pete [mailto:peted26-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org]
Sent: Monday, December 26, 2005 11:44 PM
To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
Subject: [Rails] logging a users ip address
is there an easy way of logging a users ip address via ruby?
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails